Modified: mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/LocalizedFtpReply.java URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/LocalizedFtpReply.java?rev=764544&r1=764543&r2=764544&view=diff ============================================================================== --- mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/LocalizedFtpReply.java (original) +++ mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/LocalizedFtpReply.java Mon Apr 13 18:01:32 2009 @@ -40,467 +40,18 @@ */ public class LocalizedFtpReply extends DefaultFtpReply { - - public static final String CLIENT_ACCESS_TIME = "client.access.time"; - - public static final String CLIENT_CON_TIME = "client.con.time"; - - public static final String CLIENT_DIR = "client.dir"; - - public static final String CLIENT_HOME = "client.home"; - - public static final String CLIENT_IP = "client.ip"; - - public static final String CLIENT_LOGIN_NAME = "client.login.name"; - - public static final String CLIENT_LOGIN_TIME = "client.login.time"; - - public static final String OUTPUT_CODE = "output.code"; - - public static final String OUTPUT_MSG = "output.msg"; - - public static final String REQUEST_ARG = "request.arg"; - - public static final String REQUEST_CMD = "request.cmd"; - - public static final String REQUEST_LINE = "request.line"; - - // /////////////////////// All Server Vatiables ///////////////////////// - public static final String SERVER_IP = "server.ip"; - - public static final String SERVER_PORT = "server.port"; - - public static final String STAT_CON_CURR = "stat.con.curr"; - - public static final String STAT_CON_TOTAL = "stat.con.total"; - - public static final String STAT_DIR_CREATE_COUNT = "stat.dir.create.count"; - - public static final String STAT_DIR_DELETE_COUNT = "stat.dir.delete.count"; - - public static final String STAT_FILE_DELETE_COUNT = "stat.file.delete.count"; - - public static final String STAT_FILE_DOWNLOAD_BYTES = "stat.file.download.bytes"; - - public static final String STAT_FILE_DOWNLOAD_COUNT = "stat.file.download.count"; - - public static final String STAT_FILE_UPLOAD_BYTES = "stat.file.upload.bytes"; - - public static final String STAT_FILE_UPLOAD_COUNT = "stat.file.upload.count"; - - public static final String STAT_LOGIN_ANON_CURR = "stat.login.anon.curr"; - - public static final String STAT_LOGIN_ANON_TOTAL = "stat.login.anon.total"; - - public static final String STAT_LOGIN_CURR = "stat.login.curr"; - - public static final String STAT_LOGIN_TOTAL = "stat.login.total"; - - public static final String STAT_START_TIME = "stat.start.time"; - public static LocalizedFtpReply translate(FtpIoSession session, FtpRequest request, FtpServerContext context, int code, String subId, String basicMsg) { - String msg = translateMessage(session, request, context, code, subId, + String msg = FtpReplyTranslator.translateMessage(session, request, context, code, subId, basicMsg); return new LocalizedFtpReply(code, msg); } - private static String translateMessage(FtpIoSession session, - FtpRequest request, FtpServerContext context, int code, - String subId, String basicMsg) { - MessageResource resource = context.getMessageResource(); - String lang = session.getLanguage(); - - String msg = null; - if (resource != null) { - msg = resource.getMessage(code, subId, lang); - } - if (msg == null) { - msg = ""; - } - msg = replaceVariables(session, request, context, code, basicMsg, msg); - - return msg; - } - - /** - * Replace server variables. - */ - private static String replaceVariables(FtpIoSession session, - FtpRequest request, FtpServerContext context, int code, - String basicMsg, String str) { - - int startIndex = 0; - int openIndex = str.indexOf('{', startIndex); - if (openIndex == -1) { - return str; - } - - int closeIndex = str.indexOf('}', startIndex); - if ((closeIndex == -1) || (openIndex > closeIndex)) { - return str; - } - - StringBuffer sb = new StringBuffer(128); - sb.append(str.substring(startIndex, openIndex)); - while (true) { - String varName = str.substring(openIndex + 1, closeIndex); - sb.append(getVariableValue(session, request, context, code, - basicMsg, varName)); - - startIndex = closeIndex + 1; - openIndex = str.indexOf('{', startIndex); - if (openIndex == -1) { - sb.append(str.substring(startIndex)); - break; - } - - closeIndex = str.indexOf('}', startIndex); - if ((closeIndex == -1) || (openIndex > closeIndex)) { - sb.append(str.substring(startIndex)); - break; - } - sb.append(str.substring(startIndex, openIndex)); - } - return sb.toString(); - } - - /** - * Get the variable value. - */ - private static String getVariableValue(FtpIoSession session, - FtpRequest request, FtpServerContext context, int code, - String basicMsg, String varName) { - - String varVal = null; - - // all output variables - if (varName.startsWith("output.")) { - varVal = getOutputVariableValue(session, code, basicMsg, varName); - } - - // all server variables - else if (varName.startsWith("server.")) { - varVal = getServerVariableValue(session, varName); - } - - // all request variables - else if (varName.startsWith("request.")) { - varVal = getRequestVariableValue(session, request, varName); - } - - // all statistical variables - else if (varName.startsWith("stat.")) { - varVal = getStatisticalVariableValue(session, context, varName); - } - - // all client variables - else if (varName.startsWith("client.")) { - varVal = getClientVariableValue(session, varName); - } - - if (varVal == null) { - varVal = ""; - } - return varVal; - } - - /** - * Get client variable value. - */ - private static String getClientVariableValue(FtpIoSession session, - String varName) { - - String varVal = null; - - // client ip - if (varName.equals(CLIENT_IP)) { - if (session.getRemoteAddress() instanceof InetSocketAddress) { - InetSocketAddress remoteSocketAddress = (InetSocketAddress) session - .getRemoteAddress(); - varVal = remoteSocketAddress.getAddress().getHostAddress(); - } - - } - - // client connection time - else if (varName.equals(CLIENT_CON_TIME)) { - varVal = DateUtils.getISO8601Date(session.getCreationTime()); - } - - // client login name - else if (varName.equals(CLIENT_LOGIN_NAME)) { - if (session.getUser() != null) { - varVal = session.getUser().getName(); - } - } - - // client login time - else if (varName.equals(CLIENT_LOGIN_TIME)) { - varVal = DateUtils.getISO8601Date(session.getLoginTime().getTime()); - } - - // client last access time - else if (varName.equals(CLIENT_ACCESS_TIME)) { - varVal = DateUtils.getISO8601Date(session.getLastAccessTime() - .getTime()); - } - - // client home - else if (varName.equals(CLIENT_HOME)) { - varVal = session.getUser().getHomeDirectory(); - } - - // client directory - else if (varName.equals(CLIENT_DIR)) { - FileSystemView fsView = session.getFileSystemView(); - if (fsView != null) { - try { - varVal = fsView.getWorkingDirectory().getAbsolutePath(); - } catch (Exception ex) { - varVal = ""; - } - } - } - return varVal; - } - - /** - * Get output variable value. - */ - private static String getOutputVariableValue(FtpIoSession session, - int code, String basicMsg, String varName) { - String varVal = null; - - // output code - if (varName.equals(OUTPUT_CODE)) { - varVal = String.valueOf(code); - } - - // output message - else if (varName.equals(OUTPUT_MSG)) { - varVal = basicMsg; - } - - return varVal; - } - - /** - * Get request variable value. - */ - private static String getRequestVariableValue(FtpIoSession session, - FtpRequest request, String varName) { - - String varVal = null; - - if (request == null) { - return ""; - } - - // request line - if (varName.equals(REQUEST_LINE)) { - varVal = request.getRequestLine(); - } - - // request command - else if (varName.equals(REQUEST_CMD)) { - varVal = request.getCommand(); - } - - // request argument - else if (varName.equals(REQUEST_ARG)) { - varVal = request.getArgument(); - } - - return varVal; - } - - /** - * Get server variable value. - */ - private static String getServerVariableValue(FtpIoSession session, - String varName) { - - String varVal = null; - - SocketAddress localSocketAddress = session.getLocalAddress(); - - if (localSocketAddress instanceof InetSocketAddress) { - InetSocketAddress localInetSocketAddress = (InetSocketAddress) localSocketAddress; - // server address - if (varName.equals(SERVER_IP)) { - - InetAddress addr = localInetSocketAddress.getAddress(); - - if (addr != null) { - varVal = addr.getHostAddress(); - } - } - - // server port - else if (varName.equals(SERVER_PORT)) { - varVal = String.valueOf(localInetSocketAddress.getPort()); - } - } - - return varVal; - } - - /** - * Get statistical connection variable value. - */ - private static String getStatisticalConnectionVariableValue( - FtpIoSession session, FtpServerContext context, String varName) { - String varVal = null; - FtpStatistics stat = context.getFtpStatistics(); - - // total connection number - if (varName.equals(STAT_CON_TOTAL)) { - varVal = String.valueOf(stat.getTotalConnectionNumber()); - } - - // current connection number - else if (varName.equals(STAT_CON_CURR)) { - varVal = String.valueOf(stat.getCurrentConnectionNumber()); - } - - return varVal; - } - - /** - * Get statistical directory variable value. - */ - private static String getStatisticalDirectoryVariableValue( - FtpIoSession session, FtpServerContext context, String varName) { - String varVal = null; - FtpStatistics stat = context.getFtpStatistics(); - - // total directory created - if (varName.equals(STAT_DIR_CREATE_COUNT)) { - varVal = String.valueOf(stat.getTotalDirectoryCreated()); - } - - // total directory removed - else if (varName.equals(STAT_DIR_DELETE_COUNT)) { - varVal = String.valueOf(stat.getTotalDirectoryRemoved()); - } - - return varVal; - } - - /** - * Get statistical file variable value. - */ - private static String getStatisticalFileVariableValue(FtpIoSession session, - FtpServerContext context, String varName) { - String varVal = null; - FtpStatistics stat = context.getFtpStatistics(); - - // total number of file upload - if (varName.equals(STAT_FILE_UPLOAD_COUNT)) { - varVal = String.valueOf(stat.getTotalUploadNumber()); - } - - // total bytes uploaded - else if (varName.equals(STAT_FILE_UPLOAD_BYTES)) { - varVal = String.valueOf(stat.getTotalUploadSize()); - } - - // total number of file download - else if (varName.equals(STAT_FILE_DOWNLOAD_COUNT)) { - varVal = String.valueOf(stat.getTotalDownloadNumber()); - } - - // total bytes downloaded - else if (varName.equals(STAT_FILE_DOWNLOAD_BYTES)) { - varVal = String.valueOf(stat.getTotalDownloadSize()); - } - - // total number of files deleted - else if (varName.equals(STAT_FILE_DELETE_COUNT)) { - varVal = String.valueOf(stat.getTotalDeleteNumber()); - } - - return varVal; - } - - /** - * Get statistical login variable value. - */ - private static String getStatisticalLoginVariableValue( - FtpIoSession session, FtpServerContext context, String varName) { - String varVal = null; - FtpStatistics stat = context.getFtpStatistics(); - - // total login number - if (varName.equals(STAT_LOGIN_TOTAL)) { - varVal = String.valueOf(stat.getTotalLoginNumber()); - } - - // current login number - else if (varName.equals(STAT_LOGIN_CURR)) { - varVal = String.valueOf(stat.getCurrentLoginNumber()); - } - - // total anonymous login number - else if (varName.equals(STAT_LOGIN_ANON_TOTAL)) { - varVal = String.valueOf(stat.getTotalAnonymousLoginNumber()); - } - - // current anonymous login number - else if (varName.equals(STAT_LOGIN_ANON_CURR)) { - varVal = String.valueOf(stat.getCurrentAnonymousLoginNumber()); - } - - return varVal; - } - - /** - * Get statistical variable value. - */ - private static String getStatisticalVariableValue(FtpIoSession session, - FtpServerContext context, String varName) { - - String varVal = null; - FtpStatistics stat = context.getFtpStatistics(); - - // server start time - if (varName.equals(STAT_START_TIME)) { - varVal = DateUtils.getISO8601Date(stat.getStartTime().getTime()); - } - - // connection statistical variables - else if (varName.startsWith("stat.con")) { - varVal = getStatisticalConnectionVariableValue(session, context, - varName); - } - - // login statistical variables - else if (varName.startsWith("stat.login.")) { - varVal = getStatisticalLoginVariableValue(session, context, varName); - } - - // file statistical variable - else if (varName.startsWith("stat.file")) { - varVal = getStatisticalFileVariableValue(session, context, varName); - } - - // directory statistical variable - else if (varName.startsWith("stat.dir.")) { - varVal = getStatisticalDirectoryVariableValue(session, context, - varName); - } - - return varVal; - } - /** * Private constructor, only allow creating through factory method */ - private LocalizedFtpReply(int code, String message) { + protected LocalizedFtpReply(int code, String message) { super(code, message); } - - }
Added: mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/LocalizedRenameFtpReply.java URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/LocalizedRenameFtpReply.java?rev=764544&view=auto ============================================================================== --- mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/LocalizedRenameFtpReply.java (added) +++ mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/LocalizedRenameFtpReply.java Mon Apr 13 18:01:32 2009 @@ -0,0 +1,104 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.ftpserver.impl; + +import org.apache.ftpserver.ftplet.FtpFile; +import org.apache.ftpserver.ftplet.FtpRequest; +import org.apache.ftpserver.ftplet.RenameFtpReply; + +/** + * An implementation of <code>RenameFtpReply</code> that is sent when a file + * or directory is renamed. + * + * @author Sai Pullabhotla + * @version $Revision: 1.1 $ + * + */ + +public class LocalizedRenameFtpReply extends LocalizedFtpReply implements + RenameFtpReply { + + /** + * The from file + */ + private FtpFile from = null; + + /** + * The to file + */ + private FtpFile to = null; + + /** + * Creates a new instance of <code>LocalizedRenameFtpReply</code>. + * + * @param code + * the reply code + * @param message + * the detailed message + * @param from + * the old file + * @param to + * the new file + */ + protected LocalizedRenameFtpReply(int code, String message, FtpFile from, + FtpFile to) { + super(code, message); + this.from = from; + this.to = to; + } + + public FtpFile getFrom() { + return from; + } + + public FtpFile getTo() { + return to; + } + + /** + * Returns the localized reply that contains all details about the rename + * operation. + * + * @param session + * the FTP session + * @param request + * the FTP request + * @param context + * the FTP server context + * @param code + * the reply code + * @param subId + * the sub message ID + * @param basicMsg + * the basic message + * @param from + * the file or directory as it was before the rename + * @param to + * the file or directory after the rename + * @return the localized reply + */ + public static LocalizedRenameFtpReply translate(FtpIoSession session, + FtpRequest request, FtpServerContext context, int code, String subId, + String basicMsg, FtpFile from, FtpFile to) { + String msg = FtpReplyTranslator.translateMessage(session, request, + context, code, subId, basicMsg); + return new LocalizedRenameFtpReply(code, msg, from, to); + } +} Added: mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DataTransferFtpReply.java URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DataTransferFtpReply.java?rev=764544&view=auto ============================================================================== --- mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DataTransferFtpReply.java (added) +++ mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DataTransferFtpReply.java Mon Apr 13 18:01:32 2009 @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.ftpserver.ftplet; + +/** + * A more specific type of FTP reply that is sent by the commands that transfer + * data over the data connection. These commands include LIST, RETR, STOR, STOU + * etc. + * + * @author Sai Pullabhotla + * @version $Revision: 1.1 $ + * + */ + +public interface DataTransferFtpReply extends FtpReply { + + /** + * Returns the file that was transferred (uploaded, downloaded or the + * directory that was listed). + * + * @return the file that was transferred (uploaded, downloaded or the + * directory that was listed). May return <code>null</code>, if + * the file information is not available because the request was bad + * or any other reason. + */ + FtpFile getFile(); + + /** + * Returns the number of bytes transferred. + * + * @return the number of bytes transferred. + */ + long getBytesTransferred(); + +} Modified: mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DefaultFtpReply.java URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DefaultFtpReply.java?rev=764544&r1=764543&r2=764544&view=diff ============================================================================== --- mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DefaultFtpReply.java (original) +++ mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DefaultFtpReply.java Mon Apr 13 18:01:32 2009 @@ -30,6 +30,11 @@ private int code; private String message; + + /** + * time when this reply was sent. + */ + private long sentTime = 0L; private static final String CRLF = "\r\n"; @@ -41,6 +46,7 @@ public DefaultFtpReply(final int code, final String message) { this.code = code; this.message = message; + this.sentTime = System.currentTimeMillis(); } /** @@ -57,6 +63,7 @@ sb.append('\n'); } this.message = sb.toString(); + this.sentTime = System.currentTimeMillis(); } /** @@ -72,7 +79,15 @@ public String getMessage() { return message; } - + + public long getSentTime() { + return sentTime; + } + + public boolean isPositive() { + return code < 400; + } + /* * (non-Javadoc) * Added: mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileActionFtpReply.java URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileActionFtpReply.java?rev=764544&view=auto ============================================================================== --- mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileActionFtpReply.java (added) +++ mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileActionFtpReply.java Mon Apr 13 18:01:32 2009 @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.ftpserver.ftplet; + +/** + * A more specific type of FtpReply that is sent for commands that act on a + * single file or directory such as MKD, DELE, RMD etc. + * + * @author Sai Pullabhotla + * @version $Revision: 1.1 $ + * + */ + +public interface FileActionFtpReply extends FtpReply { + + /** + * Returns the file on which the action was taken. + * + * @return the file on which the action was taken. May return + * <code>null</code>, if the file information is not available. + */ + public FtpFile getFile(); +} Modified: mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpFile.java URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpFile.java?rev=764544&r1=764543&r2=764544&view=diff ============================================================================== --- mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpFile.java (original) +++ mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpFile.java Mon Apr 13 18:01:32 2009 @@ -123,7 +123,16 @@ * @return The size of the {...@link FtpFile} in bytes */ long getSize(); - + + /** + * Returns the physical location or path of the file. It is completely up to + * the implementation to return appropriate value based on the file system + * implementation. + * + * @return the physical location or path of the file. + */ + Object getPhysicalFile(); + /** * Create directory. * @return true if the operation was successful Modified: mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpReply.java URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpReply.java?rev=764544&r1=764543&r2=764544&view=diff ============================================================================== --- mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpReply.java (original) +++ mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpReply.java Mon Apr 13 18:01:32 2009 @@ -245,7 +245,16 @@ * @return The reply message */ String getMessage(); - + + /** + * Returns the timestamp (in milliseconds since the epoch time) when this + * reply was sent. + * + * @return the timestamp (in milliseconds since the epoch time) when this + * reply was sent. + */ + long getSentTime(); + /** * Must implement toString to format the reply as described in the RFC. Most * important is the handling of multi-line replies. @@ -253,4 +262,11 @@ * @return The formated reply */ String toString(); + + /** + * Tells whether or not this reply indicates a positive completion. + * @return <code>true</code>, if this reply is a positive completion or + * positive intermediate reply; <code>false</code>, otherwise. + */ + boolean isPositive(); } Modified: mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpRequest.java URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpRequest.java?rev=764544&r1=764543&r2=764544&view=diff ============================================================================== --- mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpRequest.java (original) +++ mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpRequest.java Mon Apr 13 18:01:32 2009 @@ -51,4 +51,13 @@ * @return true if an argument is available */ boolean hasArgument(); + + /** + * Returns the timestamp (milliseconds since the epoch time) when this + * request was received. + * + * @return the timestamp (milliseconds since the epoch time) when this + * request was received. + */ + long getReceivedTime(); } Added: mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/RenameFtpReply.java URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/RenameFtpReply.java?rev=764544&view=auto ============================================================================== --- mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/RenameFtpReply.java (added) +++ mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/RenameFtpReply.java Mon Apr 13 18:01:32 2009 @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.ftpserver.ftplet; + +/** + * A more specific type of reply that is sent when a file is attempted to + * rename. This reply is sent by the RNTO command. + * + * @author Sai Pullabhotla + * @version $Revision: 1.1 $ + * + */ + +public interface RenameFtpReply extends FtpReply { + + /** + * Returns the file before the rename. + * + * @return the file before the rename. May return <code>null</code>, if + * the file information is not available. + */ + public FtpFile getFrom(); + + /** + * Returns the file after the rename. + * + * @return the file after the rename. May return <code>null</code>, if + * the file information is not available. + */ + public FtpFile getTo(); + +}