You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by ap...@apache.org on 2012/09/28 17:18:32 UTC

svn commit: r1391500 - in /mina/site/trunk/content/ftpserver: ftplet.mdtext ftpserver_commands.mdtext ftpserver_port_21.mdtext ftpserver_site_commands.mdtext managing_users.mdtext messages.mdtext

Author: apaliwal
Date: Fri Sep 28 15:18:31 2012
New Revision: 1391500

URL: http://svn.apache.org/viewvc?rev=1391500&view=rev
Log:
more ftpserver pages moved

Added:
    mina/site/trunk/content/ftpserver/ftplet.mdtext
    mina/site/trunk/content/ftpserver/ftpserver_commands.mdtext
    mina/site/trunk/content/ftpserver/ftpserver_port_21.mdtext
    mina/site/trunk/content/ftpserver/ftpserver_site_commands.mdtext
    mina/site/trunk/content/ftpserver/managing_users.mdtext
    mina/site/trunk/content/ftpserver/messages.mdtext

Added: mina/site/trunk/content/ftpserver/ftplet.mdtext
URL: http://svn.apache.org/viewvc/mina/site/trunk/content/ftpserver/ftplet.mdtext?rev=1391500&view=auto
==============================================================================
--- mina/site/trunk/content/ftpserver/ftplet.mdtext (added)
+++ mina/site/trunk/content/ftpserver/ftplet.mdtext Fri Sep 28 15:18:31 2012
@@ -0,0 +1,539 @@
+Title: Ftplet
+Notice:    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.
+
+
+# Ftplet
+
+## Overview
+
+The Ftplet API is a simple API used to handle different FtpServer notifications. Apache FtpServer is a Ftplet container, allowing administrators to deploy Ftplet to carry out a variety of complex FTP event handler tasks.
+
+Implementing a custom Ftplet is generally a simple task, most of whose complexity lies in coding the actual work to be done by the Ftplet. This is largely due to the simplicity of the Ftplet interface and the fact that a DefaultFtplet class is provided as part of the Ftplet package.
+
+The Ftplet interface supports two lifecycle methods to provide initialization (the init() method) and shutdown (the destroy() method). Main processing is done in different notification methods, which take a FtpSession object and a FtpRequest object. All the notification methods return FtpletResult object to indicate the future action.
+
+There will be one instance of Ftplet object. Notification methods will be called from different connections running in different threads. So Ftplet implementation has to be thread-safe. Each connection will have its own request (FtpRequest) and session (FtpSession) objects.
+
+## Main Classes
+
+### FtpletResult
+
+This class encapsulates the return values of the ftplet methods. There are four static FtpletResult values.
+
+* __DEFAULT__ : This return value indicates that the next ftplet method will be called. If no other ftplet is available, the FtpServer will process the request.
+* __NO_FTPLET__ : This return value indicates that the other ftplet methods will not be called but the FtpServer will continue processing this request.
+* __SKIP__ : It indicates that the server will skip everything. No further processing will be done for this request.
+* __DISCONNECT__ : It indicates that the server will skip and disconnect the client. No other request from the same client will be served.
+
+So, DEFAULT < NO_FTPLET < SKIP > DISCONNECT. If the Ftplet returns null, DEFAULT is assumed.
+
+## FtpSession
+
+The session object is kept for the entire user session. So the attributes set by setAttribute() will be always available later unless that attribute is removed. Different session will have different FtpSession objects. From here we can get user information, data streams, user file system view etc.
+
+Ftplets can use this to send custom codes and messages to client.
+
+## FtpRequest
+
+Provides the client request information to a ftplet. Contains the FTP command and argument.
+
+## Ftplet
+
+There will be only one instance of Ftplet. During startup the Ftplets will be initialized. The initialization sequence is same as the Ftplet sequence in the configuration. Then all notification methods will be called and when the FtpServer goes down, the Ftplet will be destroyed. The following method describes all the notification methods.
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Method </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> onConnect </TD>
+<TD class="confluenceTd"> Client connect notification method. This is the first method FtpServer will call. If it returns SKIP, IP restriction check, connection limit check will not be performed and the server will not send the welcome message (220). </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDisconnect </TD>
+<TD class="confluenceTd"> Client disconnect notification method. This is the last method FtpServer will call. Whatever it returns, the client connection will be closed. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> beforeCommand </TD>
+<TD class="confluenceTd"> Called before the server invoke the command.  </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> afterCommand </TD>
+<TD class="confluenceTd"> Called after the server as invoked the command. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+## DefaultFtplet
+
+DefaultFtplet provides some convenience methods for common FTP commands. Users can easily extend the DefaultFtplet class and choose what methods to override and handle.
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Method </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> onLogin </TD>
+<TD class="confluenceTd"> Client login notification method. This will be called after the user authentication. In this case the FtpServer has already sent the login OK (230) reply. This is called during FTP PASS request. The FTP session will be disconnected in the return value is FtpletResult.DISCONNECT. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDeleteStart </TD>
+<TD class="confluenceTd"> Before file deletion this method will be called. Before this FtpServer will not check anything like file existence or permission. The requested file name can be get from request argument. We can get the file object from the request file system view. This is called in DELE FTP command. The method should send some responses (like 250, 450, 550) in case of SKIP return value. In this case, the server will skip the command processing and the ftplet has to send appropriate response values. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDeleteEnd </TD>
+<TD class="confluenceTd"> This method will be called after the file deletion, successful or not. In this case the FtpServer has already sent the reply message. This is called in DELE FTP command. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadStart </TD>
+<TD class="confluenceTd"> This method will be called before the file upload. The file name can be get from the request argument. We can get the data input stream from request. This will be called before the permission check. This is called during STOR command. If the method returns SKIP, it has to send responses before and after processing. For example, before opening the data input stream, the method has to notify the client with a response code 150. Similarly, after the data transfer, the method has to notify the client with a response code 226. In case of any error, the method should send different response codes like 450, 425, 426, 551. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadEnd </TD>
+<TD class="confluenceTd"> This notification method will be called to indicate that the file transfer is successful and the server has send the replies. In case of any error this method will not be called. This is called in STOR command. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDownloadStart </TD>
+<TD class="confluenceTd"> This is file download request notification method called during RETR command. This will be called before the file download. We can get the file name argument from request. Similarly, the data output stream can be get from the request. This will be called before the file existance and permissoin check. If the method returns SKIP, it has to send responses before and after processing. For example, before opening the data output stream, the method has to notify the client with a response code 150. Similarly, after the data transfer, the method has to notify the client with a response code 226. In case of any error, the method should send different response codes like 450, 425, 426, 551. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDownloadEnd </TD>
+<TD class="confluenceTd"> This notification method will be called to indicate that the file transfer is successful and the server has send the replies in RETR command.  </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRmdirStart </TD>
+<TD class="confluenceTd"> Before directory deletion this method will be called during RMD command. Before this FtpServer will not check anything like directory existance or permission. The requested directory name can be get from request argument. If the method returns the SKIP, it has to send appropriate response codes to clients like 250, 450,                              550. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRmdirEnd </TD>
+<TD class="confluenceTd"> This method will be called after the invocation of the RMD command. In this case the FtpServer has already sent the reply message. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onMkdirStart </TD>
+<TD class="confluenceTd"> Before directory creation this method will be called during MKD command. Before this FtpServer will not check anything like directory existance or permission. The requested directory name can be get from request argument. If it returns SKIP, it has to send appropriate response codes to clients like 250, 550. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onMkdirEnd </TD>
+<TD class="confluenceTd"> This method will be called if the directory creation is successful in MKD command. In this case the FtpServer has already sent the reply message.  </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onAppendStart </TD>
+<TD class="confluenceTd"> This is file append request notification method called in APPE command. The file name can be get from the request argument. We can get the data input stream from request. This will be called before the permission check. If the method returns SKIP, it has to send responses before and after processing. For example, before opening the data input stream, the method has to notify the client with a response code 150. Similarly, after the data transfer, the method has to notify the client with a response                              code 226. In case of any error, the method should send different response codes like 450, 425, 426, 551. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onAppendEnd </TD>
+<TD class="confluenceTd"> This is file append success notification method called in APPE command.  </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadUniqueStart </TD>
+<TD class="confluenceTd"> This is unique file create request notification method called in STOU command. We can get the data input stream from request. This will be called before the permission check. If the method returns SKIP, it has to send responses before and after processing. For example, before opening the data input stream, the method has                              to notify the client with a response code 150. Similarly, after the data transfer, the method has to notify the client with a response code 226. In case of any error, the method should send different response codes like 450, 425, 426, 551. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadUniqueEnd </TD>
+<TD class="confluenceTd"> This is unique file create success notification method called in STOU command. This notification method will be called to indicate the the server has send the replies.  </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRenameStart </TD>
+<TD class="confluenceTd"> This is file rename start notification method called in RNTO command. This will be called before the file existance or permission check. The &quot;rename from&quot; file object can be get from request object. If it returns SKIP, it has to send appropriate response codes like 503, 553, 250. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRenameEnd </TD>
+<TD class="confluenceTd"> This is file rename success notification method called in RNFR command. This will be called before the file existance or permission check. The &quot;rename from&quot; file object an be get from request object. This notification method will be called after the invocation of the RNTO command and the server has send the reply message.  </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onSite </TD>
+<TD class="confluenceTd"> This is SITE command start notification method. It gives a chance to implement custom SITE command. If this method returns SKIP or DISCONNECT, the existing SITE commands will not be executed. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+## Response Codes
+
+This section gives an overview on different response codes which might be useful in developing custom ftplet. These commands might be used when the ftplet method return value is SKIP.
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Method </TH>
+<TH class="confluenceTh"> Response Code </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> onConnect </TD>
+<TD class="confluenceTd"> 220 </TD>
+<TD class="confluenceTd"> Service ready for new user. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onConnect </TD>
+<TD class="confluenceTd"> 530 </TD>
+<TD class="confluenceTd"> No server access from the IP. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onConnect </TD>
+<TD class="confluenceTd"> 530 </TD>
+<TD class="confluenceTd"> Maximum server connection has been reached. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDisconnect </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onLogin </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDeleteStart </TD>
+<TD class="confluenceTd"> 250 </TD>
+<TD class="confluenceTd"> Requested file action okay </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDeleteStart </TD>
+<TD class="confluenceTd"> 450 </TD>
+<TD class="confluenceTd"> No permission to delete. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDeleteStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Not a valid file. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDeleteStart </TD>
+<TD class="confluenceTd"> 450 </TD>
+<TD class="confluenceTd"> Can't delete file. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDeleteEnd </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadStart </TD>
+<TD class="confluenceTd"> 150 </TD>
+<TD class="confluenceTd"> File status okay; about to open data connection. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadStart </TD>
+<TD class="confluenceTd"> 226 </TD>
+<TD class="confluenceTd"> Transfer complete. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Invalid path. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Permission denied. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadStart </TD>
+<TD class="confluenceTd"> 425 </TD>
+<TD class="confluenceTd"> Can't open data connection. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadStart </TD>
+<TD class="confluenceTd"> 426 </TD>
+<TD class="confluenceTd"> Data connection error. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadStart </TD>
+<TD class="confluenceTd"> 551 </TD>
+<TD class="confluenceTd"> Error on output file. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadEnd </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDownloadStart </TD>
+<TD class="confluenceTd"> 150 </TD>
+<TD class="confluenceTd"> File status okay; about to open data connection. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDownloadStart </TD>
+<TD class="confluenceTd"> 226 </TD>
+<TD class="confluenceTd"> Transfer complete. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDownloadStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> No such file or directory. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDownloadStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Not a plain file. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDownloadStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Permission denied. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDownloadStart </TD>
+<TD class="confluenceTd"> 425 </TD>
+<TD class="confluenceTd"> Can't open data connection. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDownloadStart </TD>
+<TD class="confluenceTd"> 426 </TD>
+<TD class="confluenceTd"> Data connection error. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDownloadStart </TD>
+<TD class="confluenceTd"> 551 </TD>
+<TD class="confluenceTd"> Error on input file. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onDownloadEnd </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRmdirStart </TD>
+<TD class="confluenceTd"> 250 </TD>
+<TD class="confluenceTd"> Directory removed. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRmdirStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Not a valid directory. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRmdirStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Permission denied. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRmdirStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Can't remove directory. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRmdirEnd </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onMkdirStart </TD>
+<TD class="confluenceTd"> 250 </TD>
+<TD class="confluenceTd"> Directory created. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onMkdirStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Not a valid file. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onMkdirStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Permission denied </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onMkdirStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Directory already exists. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onMkdirStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Can't create directory. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onMkdirEnd </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onAppendStart </TD>
+<TD class="confluenceTd"> 150 </TD>
+<TD class="confluenceTd"> File status okay; about to open data connection. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onAppendStart </TD>
+<TD class="confluenceTd"> 226 </TD>
+<TD class="confluenceTd"> Transfer complete. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onAppendStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Not a plain file. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onAppendStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Permission denied. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onAppendStart </TD>
+<TD class="confluenceTd"> 425 </TD>
+<TD class="confluenceTd"> Can't open data connection. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onAppendStart </TD>
+<TD class="confluenceTd"> 426 </TD>
+<TD class="confluenceTd"> Data connection error. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onAppendStart </TD>
+<TD class="confluenceTd"> 551 </TD>
+<TD class="confluenceTd"> Error on output file. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onAppendEnd </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadUniqueStart </TD>
+<TD class="confluenceTd"> 150 </TD>
+<TD class="confluenceTd"> File status okay; about to open data connection. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadUniqueStart </TD>
+<TD class="confluenceTd"> 250 </TD>
+<TD class="confluenceTd"> filename: Transfer started. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadUniqueStart </TD>
+<TD class="confluenceTd"> 226 </TD>
+<TD class="confluenceTd"> filename: Transfer complete. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadUniqueStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Unique file name error. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadUniqueStart </TD>
+<TD class="confluenceTd"> 550 </TD>
+<TD class="confluenceTd"> Permission denied. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadUniqueStart </TD>
+<TD class="confluenceTd"> 425 </TD>
+<TD class="confluenceTd"> Can't open data connection. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadUniqueStart </TD>
+<TD class="confluenceTd"> 426 </TD>
+<TD class="confluenceTd"> Data connection error. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadUniqueStart </TD>
+<TD class="confluenceTd"> 551 </TD>
+<TD class="confluenceTd"> Error on output file. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onUploadUniqueEnd </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRenameStart </TD>
+<TD class="confluenceTd"> 250 </TD>
+<TD class="confluenceTd"> Requested file action okay, file renamed. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRenameStart </TD>
+<TD class="confluenceTd"> 503 </TD>
+<TD class="confluenceTd"> Can't find the file which has to be renamed. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRenameStart </TD>
+<TD class="confluenceTd"> 553 </TD>
+<TD class="confluenceTd"> Not a valid file name. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRenameStart </TD>
+<TD class="confluenceTd"> 553 </TD>
+<TD class="confluenceTd"> Permission denied. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRenameStart </TD>
+<TD class="confluenceTd"> 553 </TD>
+<TD class="confluenceTd"> No such file or directory. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRenameStart </TD>
+<TD class="confluenceTd"> 553 </TD>
+<TD class="confluenceTd"> Can't rename file. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onRenameEnd </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+<TD class="confluenceTd"> <BR class="atl-forced-newline"> </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onSite </TD>
+<TD class="confluenceTd"> 200 </TD>
+<TD class="confluenceTd"> Command SITE okay. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onSite </TD>
+<TD class="confluenceTd"> 530 </TD>
+<TD class="confluenceTd"> Permission denied. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onSite </TD>
+<TD class="confluenceTd"> 502 </TD>
+<TD class="confluenceTd"> Not implemented. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> onSite </TD>
+<TD class="confluenceTd"> 500 </TD>
+<TD class="confluenceTd"> Execution failed. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+## Configuration
+
+Ftplet will get the Ftplet specific configuration as the init() method argument.
+
+## Implementation
+
+Ftplets are regular POJOs. If running the server as embedded they can be added to the FtpletContainer as normal instances of the object. If using the XML configuration, they are configured and Spring beans within the ftplets element. Here's an example:
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+&lt;ftplets&gt; 
+  &lt;ftplet name=<SPAN class="code-quote">&quot;ftplet1&quot;</SPAN>&gt; 
+    &lt;beans:bean class=<SPAN class="code-quote">&quot;org.apache.ftpserver.examples.MyFtplet&quot;</SPAN>&gt; 
+      &lt;beans:property name=<SPAN class="code-quote">&quot;foo&quot;</SPAN> value=<SPAN class="code-quote">&quot;123&quot;</SPAN> /&gt; 
+    &lt;/beans:bean&gt; 
+  &lt;/ftplet&gt; 
+&lt;/ftplets&gt;
+</PRE>
+</DIV></DIV>
+
+## Deployment
+
+The Ftplet must be added to Apache FtpServer classpath so that the Ftplet can be loaded. There are three ways you can do that.
+
+1. Modify your system CLASSPATH environment variable to include your ftplet classes.
+2. Copy your ftplet class files (unpacked) in the common/classes bdirectory of the FtpServer installation.
+3. Place a jar file containing the custom ftplet class files in the common/lib subdirectory of the FtpServer installation.

Added: mina/site/trunk/content/ftpserver/ftpserver_commands.mdtext
URL: http://svn.apache.org/viewvc/mina/site/trunk/content/ftpserver/ftpserver_commands.mdtext?rev=1391500&view=auto
==============================================================================
--- mina/site/trunk/content/ftpserver/ftpserver_commands.mdtext (added)
+++ mina/site/trunk/content/ftpserver/ftpserver_commands.mdtext Fri Sep 28 15:18:31 2012
@@ -0,0 +1,474 @@
+Title: FTP Commands
+Notice:    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.
+
+
+# FTP Commands
+
+This document describes all the FTP commands implemented.
+
+## ABOR
+
+Aborts the previous FTP service command and any associated transfer of data.
+
+### Server Replies
+
+226 ABOR command successful.
+
+## ACCT
+
+Provides the user's account. Not used by FtpServer.
+
+### Server Replies
+
+202 Command ACCT not implemented.
+
+## APPE
+
+Appends data to the end of a file on the remote host. If the file does not already exist, it is created. This command must be preceded by a PORT or PASV command.
+
+### Server Replies
+
+501 Syntax error.
+550 Not a plain file.
+550 Permission denied.
+150 Opening data connection.
+425 Cannot open data connection.
+426 Data connection error.
+551 Error on output file.
+226 Transfer complete.
+
+## AUTH
+
+Establishes SSL encrypted session. Only SSL type is supported.
+
+### Server Replies
+
+501 Syntax error.
+431 Service is unavailable.
+234 AUTH command okay; starting SSL connection.
+
+## CDUP
+Change to parent directory.
+
+### Server Replies
+
+250 Command okay.
+550 No such directory.
+
+## CWD
+
+Changes the working directory. If directory name is not specified, root directory (/) is assumed.
+
+### Server Replies
+
+250 Command okay.
+550 No such directory.
+
+## DELE
+
+Deletes the file specified by the provided path.
+
+### Server Replies
+
+250 Command okay.
+450 No permission to delete.
+450 Can't delete file.
+550 Not a valid file.
+501 Syntax error in parameters or arguments.
+
+## EPRT
+
+The EPRT command allows for the specification of an extended address for the data connection. The extended address MUST consist of the network protocol as well as the network and transport addresses. The format of EPRT is EPRT |<net-prt>|<net-addr>|<tcp-port>|
+
+### Server Replies
+
+501 Syntax error.
+510 EPRT is disabled.
+510 Syntax error.
+553 Host unknown.
+510 EPRT IP is not same as client IP.
+552 Not a valid port number.
+200 EPRT command okay.
+
+## EPSV
+The EPSV command requests that a server listen on a data port and wait for a connection.
+
+### Server Replies
+
+425 Cannot open passive connection.
+229 Entering passive mode (<message>).
+
+## FEAT
+
+Displays the feature list.
+
+### Server Replies
+
+221 List of all the extensions supported.
+
+## HELP
+
+Displays the help information.
+
+### Server Replies
+
+214 Help information.
+
+## LANG
+
+A new command "LANG" is added to the FTP command set to allow server-FTP process to determine in which language to present server greetings and the textual part of command responses.
+
+### Server Replies
+
+502 Not yet implemented.
+
+## LIST
+
+This command causes a list to be sent from the server to the passive DTP. If the pathname specifies a directory or other group of files, the server should transfer a list of files in the specified directory. If the pathname specifies a file then the server should send current information on the file. A null argument implies the user's current working or default directory. The data transfer is over the data connection. This command must be preceded by a PORT or PASV command.
+
+### Server Replies
+
+150 Opening data connection.
+425 Cannot open data connection.
+426 Data connection error.
+551 File listing failed.
+501 Syntax error.
+226 Closing data connection.
+
+## MDTM
+
+Returns the date and time of when a file was modified.
+
+### Server Replies
+
+501 Syntax error.
+550 File unavailable.
+213 <timestamp>
+
+## MKD
+
+This command causes the directory specified in the pathname to be created as a directory (if the pathname is absolute) or as a subdirectory of the current working directory (if the pathname is relative).
+
+### Server Replies
+
+501 Syntax error.
+550 Not a valid file.
+550 Already exists.
+550 No permission.
+250 Directory created.
+550 Cannot create directory.
+
+## MLSD
+
+Causes a list to be sent from the server to the passive DTP
+
+### Server Replies
+
+150 File status okay; about to open data connection.
+226 Closing data connection.
+425 Can't open data connection.
+426 Data connection error.
+501 Syntax error in parameters or arguments.
+551 File listing failed.
+
+## MODE
+
+Set data transfer mode. The valid values are S and Z.
+
+### Server Replies
+
+501 Syntax error.
+504 Not implemented for this command.
+200 Command okay.
+
+## NLST
+
+This command causes a directory listing to be sent from server to user site. The pathname should specify a directory or other system-specific file group descriptor; a null argument implies the current directory. The server will return a stream of names of files and no other information.
+
+### Server Replies
+
+150 Opening data connection.
+425 Cannot open data connection.
+426 Data connection error.
+551 File listing failed.
+501 Syntax error.
+226 Closing data connection.
+
+## NOOP
+
+No operation.
+
+### Server Replies
+200 Command okay.
+
+## OPTS
+
+Cause the server use optional features for the command specified.
+
+### Server Replies
+
+500 Execution failed.
+501 Syntax error in parameters or arguments.
+502 Command OPTS not implemented for ...
+Additional return codes available for different OPTS commands.
+
+## PASS
+
+The argument field is a Telnet string specifying the user's password. This command must be immediately preceded by the USER command.
+
+### Server Replies
+
+501 Syntax error.
+503 Login with USER first.
+202 Already logged-in.
+421 Maximum anonymous login limit has been reached.
+421 Maximum login limit has been reached.
+530 Authentication failed.
+230 User logged in, proceed.
+
+## PASV
+
+This command requests the server-DTP to listen on a data port (which is not its default data port) and to wait for a connection rather than initiate one upon receipt of a transfer command. The response to this command includes the host and port address this server is listening on.
+
+### Server Replies
+
+425 Cannot open passive connection.
+227 Entering passive mode (<h1,h2,h3,h4,p1,p2>)
+
+## PBSZ
+
+protection buffer size.
+
+### Server Replies
+
+200 Command okay.
+
+## PORT
+
+The argument is a HOST-PORT specification for the data port to be used in data connection. There are defaults for both the user and server data ports, and under normal circumstances this command and its reply are not needed. If this command is used, the argument is the concatenation of a 32-bit internet host address and a 16-bit TCP port address. This address information is broken into 8-bit fields and the value of each field is transmitted as a decimal number (in character string representation). The fields are separated by commas. A port command would be:
+
+PORT h1,h2,h3,h4,p1,p2
+
+### Server Replies
+
+501 Syntax error.
+510 Syntax error in parameters.
+510 Port is disabled.
+553 Host unknown.
+510 PORT IP mismatch.
+552 Invalid port number.
+200 Command PORT okay.
+
+## PROT
+Data channel protection level. The supported level values are C, P.
+
+### Server Replies
+
+501 Syntax error.
+431 Security is disabled.
+504 Server does not understand the specified protection level.
+200 Command PROT okay.
+
+## PWD
+
+This command causes the name of the current working directory to be returned in the reply.
+
+### Server Replies
+
+257 "<current directory>"
+
+## QUIT
+
+Closes connection.
+
+### Server Replies
+
+200 Goodbye.
+
+## REIN
+
+Flushes a user, without affecting transfers in progress
+
+### Server Replies
+
+220 Service ready for new user.
+
+## REST
+
+The argument field represents the server marker at which file transfer is to be restarted. This command does not cause file transfer but skips over the file to the specified data checkpoint. This command shall be immediately followed by the appropriate FTP service command which shall cause file transfer to resume.
+
+### Server Replies
+
+501 Syntax error.
+501 Not a valid number.
+501 Marker cannot be negetive.
+350 Restarting at <position>. Send STORE or RETRIEVE to initiate transfer.
+
+## RETR
+
+This command causes the server-DTP to transfer a copy of the file, specified in the pathname, to the server- or user-DTP at the other end of the data connection. The status and contents of the file at the server site shall be unaffected.
+
+### Server Replies
+
+501 Syntax error.
+550 No such file or directory.
+550 Not a plain file.
+550 Permission denied.
+150 Opening data connection.
+425 Cannot open the data connection.
+426 Data connection error.
+551 Error on input file.
+226 Transfer complete.
+
+## RMD
+
+This command causes the directory specified in the pathname to be removed as a directory (if the pathname is absolute) or as a subdirectory of the current working directory (if the pathname is relative).
+
+### Server Replies
+
+501 Syntax error.
+550 No permission.
+550 Not a valid directory.
+250 Directory removed.
+550 Cannot remove directory.
+
+## RNFR
+
+This command specifies the old pathname of the file which is to be renamed. This command must be immediately followed by a RNTO command specifying the new file pathname.
+
+### Server Replies
+
+501 Syntax error.
+550 File unavailable.
+350 Requested file action pending further information.
+
+## RNTO
+
+This command specifies the new pathname of the file specified in the immediately preceding RNFR command. Together the two commands cause a file to be renamed.
+
+### Server Replies
+
+501 Syntax error.
+503 Cannot find the file which has to be renamed.
+553 Not a valid file name.
+553 No permission.
+250 Requested file action okay, file renamed.
+553 Cannot rename file.
+
+## SITE
+
+Handle Apache FTP Server specific custom commands. Please see the SITE commands page.
+
+### Server Replies
+
+200 Command SITE okay.
+502 Command SITE not implemented for this argument.
+500 Execution failed.
+530 Access denied.
+
+## SIZE
+
+Returns the size of the file in bytes.
+
+### Server Replies
+
+501 Syntax error.
+550 No such file or directory.
+550 Not a plain file.
+213 <size>
+
+## STAT
+
+This command shall cause a status response to be sent over the control connection in the form of a reply.
+
+### Server Replies
+
+211 Statistics information.
+
+## STOR
+
+This command causes the server-DTP to accept the data transferred via the data connection and to store the data as a file at the server site. If the file specified in the pathname exists at the server site, then its contents shall be replaced by the data being transferred. A new file is created at the server site if the file specified in the pathname does not already exist.
+
+### Server Replies
+
+501 Syntax error.
+550 Invalid path.
+550 Permission denied.
+150 Opening data connection.
+425 Cannot open the data connection.
+426 Data connection error.
+551 Error on output file.
+226 Transfer complete.
+
+## STOU
+
+This command behaves like STOR except that the resultant file is to be created in the current directory under a name unique to that directory. The 250 Transfer Started response must include the name generated.
+
+### Server Replies
+
+550 Unique file name error.
+550 Permission denied.
+150 Opening data connection.
+425 Cannot open the data connection.
+250 <file> Transfer started.
+426 Data connection error.
+551 Error on output file.
+226 Transfer complete.
+
+## STRU
+
+The argument is a single Telnet character code specifying file structure. The allowed argument is F.
+
+### Server Replies
+
+501 Syntax error.
+504 Command not implemented.
+200 Command okay.
+
+## SYST
+
+This command is used to find out the type of operating system at the server.
+
+### Server Replies
+
+215 UNIX Type: Apache FTP Server
+
+## TYPE
+
+The argument specifies the representation type. The allowed types are A and I.
+
+### Server Replies
+
+501 Syntax error.
+504 Command not implemented.
+200 Command okay.
+
+## USER
+
+The argument field is a Telnet string identifying the user. The user identification is that which is required by the server for access to its file system. This command will normally be the first command transmitted by the user after the control connections are made.
+
+### Server Replies
+
+501 Syntax error.
+230 Already logged-in.
+530 Invalid user name.
+530 Anonymous connection is not allowed.
+421 Maximum anonymous login limit has been reached.
+421 Maximum login limit has been reached.
+331 Guest login okay, send your complete e-mail address as password.
+331 User name okay, need password.

Added: mina/site/trunk/content/ftpserver/ftpserver_port_21.mdtext
URL: http://svn.apache.org/viewvc/mina/site/trunk/content/ftpserver/ftpserver_port_21.mdtext?rev=1391500&view=auto
==============================================================================
--- mina/site/trunk/content/ftpserver/ftpserver_port_21.mdtext (added)
+++ mina/site/trunk/content/ftpserver/ftpserver_port_21.mdtext Fri Sep 28 15:18:31 2012
@@ -0,0 +1,33 @@
+Title: FtpServer and port 21 on Linux
+Notice:    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.
+
+
+# FtpServer and port 21 on Linux
+
+Under Linux only programs running as root is allowed to bind and listen to ports with port numbers below 1024. However, running a server which communicates with untrusted clients as root is not recommended for security reasons. The standard way to solve this problem in servers such as Apache HTTPD is to start the server as root and bind to the privileged port and then use the setuid C function to change the user ID of the current process. In Java there is no equivalent to the setuid C function in the standard API which means that one would have to use a native library to achieve the same, something which FtpServer doesn't support at the moment.
+
+So, to have FtpServer listen on port 21 but still run it as a normal user one will have to look at other solutions such as using the firewall built into Linux. It turns out that this is really simple. Using the iptables command we can add a rule to the firewall that rewrites all TCP packets coming in on port 21 so that they are effectively forwarded to port 60021:
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+sudo iptables -t nat -A PREROUTING -p tcp -m tcp --dport 21 -j REDIRECT --to-ports 60021
+</PRE>
+</DIV></DIV>
+
+We can now configure FtpServer to listen on port 60021 and it will be available on port 21 as well.
+

Added: mina/site/trunk/content/ftpserver/ftpserver_site_commands.mdtext
URL: http://svn.apache.org/viewvc/mina/site/trunk/content/ftpserver/ftpserver_site_commands.mdtext?rev=1391500&view=auto
==============================================================================
--- mina/site/trunk/content/ftpserver/ftpserver_site_commands.mdtext (added)
+++ mina/site/trunk/content/ftpserver/ftpserver_site_commands.mdtext Fri Sep 28 15:18:31 2012
@@ -0,0 +1,107 @@
+Title: SITE Commands
+Notice:    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.
+
+
+# SITE Commands
+
+This document describes all the FTP SITE commands implemented.
+
+## SITE DESCUSER
+It displays the user details.
+
+### Sample Server Replies
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>            200-
+            DESCUSER : display user information.
+            HELP     : display this message.
+            STAT     : show statistics.
+            WHO      : display all connected users.
+            ZONE     : display timezone.
+            200 End of help.
+</PRE>
+</DIV></DIV>
+
+## SITE HELP
+
+It displays all the available SITE commands.
+
+### Server Replies
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>            200-
+            DESCUSER : display user information.
+            HELP     : display this message.
+            STAT     : show statistics.
+            WHO      : display all connected users.
+            ZONE     : display timezone.
+            200 End of help.
+</PRE>
+</DIV></DIV>
+
+## SITE STAT
+
+This command displays different server statistics information. Only admin user has the permission to execute this.
+
+### Sample Server Reply
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>            200-
+            Start Time               : 2005-09-01T12:10:11
+            File Upload Number       : 0
+            File Download Number     : 0
+            File Delete Number       : 0
+            File Upload Bytes        : 0
+            File Download Bytes      : 0
+            Directory Create Number  : 0
+            Directory Remove Number  : 0
+            Current Logins           : 1
+            Total Logins             : 1
+            Current Anonymous Logins : 0
+            Total Anonymous Logins   : 0
+            Current Connections      : 1
+            Total Connections        : 1
+            200
+</PRE>
+</DIV></DIV>
+
+## SITE WHO
+
+This command displays all currently logged-in user information. It displays the user name, client IP, login time and last access time. Only admin user has the permission to execute this.
+
+### Sample Server Reply
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>            200-
+            admin           127.0.0.1       2005-09-01T12:20:26 2005-09-01T12:20:52
+            anonymous       127.0.0.1       2005-09-01T12:20:37 2005-09-01T12:20:37
+            200
+</PRE>
+</DIV></DIV>
+
+## SITE ZONE
+
+This command displays the timezone information of the FTP server in RFC 822 4-digit time zone format. The format is
+Sign TwoDigitHours TwoDigitMinutes
+
+### Sample Server Reply
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>            200 +0530
+</PRE>
+</DIV></DIV>

Added: mina/site/trunk/content/ftpserver/managing_users.mdtext
URL: http://svn.apache.org/viewvc/mina/site/trunk/content/ftpserver/managing_users.mdtext?rev=1391500&view=auto
==============================================================================
--- mina/site/trunk/content/ftpserver/managing_users.mdtext (added)
+++ mina/site/trunk/content/ftpserver/managing_users.mdtext Fri Sep 28 15:18:31 2012
@@ -0,0 +1,65 @@
+Title: Managing users
+Notice:    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.
+
+
+# Managing users
+
+Since FtpServer user manager might encrypt user passwords before saving them, manually administering the user database can be hard. There is basically three ways:
+
+## Manually
+
+Using either the PropertiesUserManager or DbUserManager you can access the data store (file or database) directly to edit users. For clear text passwords you can simply edit them. For MD5 hashed passwords, you can you use any of the available MD5 tools, for example <http://www.iwebtool.com/md5>, to hash the password before editing it. For salted passwords, use one of the methods described below.
+
+## Using the API
+
+Using the FtpServer API, you can create a user manager, configure it as your real user manager and use that to edit users. This is a simple example:
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>        PropertiesUserManagerFactory userManagerFactory = new PropertiesUserManagerFactory();
+        userManagerFactory.setFile(new File(&quot;myusers.properties&quot;));
+        userManagerFactory.setPasswordEncryptor(new SaltedPasswordEncryptor());
+        UserManager um = userManagerFactory.createUserManager();
+        BaseUser user = new BaseUser();
+        user.setName(&quot;myNewUser&quot;);
+        user.setPassword(&quot;secret&quot;);
+        user.setHomeDirectory(&quot;ftproot&quot;);
+        um.save(user);
+</PRE>
+</DIV></DIV>
+
+## Using command line tool
+
+If you're using the XML configuratio, there is a command line tool available for adding new users to your user manager.
+
+In the examples below, make sure you update the versions to reflect the correct versions for your release
+
+Windows:
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>java -cp ftpserver-core-1.0.0-M4.jar;ftplet-api-1.0.0-M4.jar;mina-core-2.0.0-M3.jar;slf4j-api-1.5.2.jar;<br>slf4j-simple-1.5.2.jar org.apache.ftpserver.main.AddUser path/to/your/config.xml
+</PRE>
+</DIV></DIV>
+
+MacOS/Linux/Unix
+
+<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
+<PRE>java -cp ftpserver-core-1.0.0-M4.jar:ftplet-api-1.0.0-M4.jar:mina-core-2.0.0-M3.jar:slf4j-api-1.5.2.jar:<br>slf4j-simple-1.5.2.jar org.apache.ftpserver.main.AddUser path/to/your/config.xml
+</PRE>
+</DIV></DIV>
+
+The program will ask you for the required data.

Added: mina/site/trunk/content/ftpserver/messages.mdtext
URL: http://svn.apache.org/viewvc/mina/site/trunk/content/ftpserver/messages.mdtext?rev=1391500&view=auto
==============================================================================
--- mina/site/trunk/content/ftpserver/messages.mdtext (added)
+++ mina/site/trunk/content/ftpserver/messages.mdtext Fri Sep 28 15:18:31 2012
@@ -0,0 +1,186 @@
+Title: Messages
+Notice:    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.
+
+
+# Messages
+
+This document explains how to customize all the Apache FtpServer reply messages.
+
+All the server messages are customizable. The default reply messages are bundled with the server. The user defined custom messages will be stored separately. This custom message file is configurable.
+
+The FtpServer project is interested in localized message bundles, please [contact the project](mailing_list.html) if you would like to donate.
+
+## Example
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+&lt;messages languages=<SPAN class="code-quote">&quot;se, no ,da&quot;</SPAN> /&gt;
+</PRE>
+</DIV></DIV>
+
+## messages element
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Attribute </TH>
+<TH class="confluenceTh"> Description </TH>
+<TH class="confluenceTh"> Required </TH>
+<TH class="confluenceTh"> Default value </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> directory </TD>
+<TD class="confluenceTd"> The directory in which message bundles can be located </TD>
+<TD class="confluenceTd"> No </TD>
+<TD class="confluenceTd">&nbsp;</TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> languages </TD>
+<TD class="confluenceTd"> A comma separated list of the languages that the server will provide messages in </TD>
+<TD class="confluenceTd"> No </TD>
+<TD class="confluenceTd">&nbsp;</TD>
+</TR>
+</TBODY></TABLE>
+</DIV>
+
+## Creating a customized message bundle
+
+### Dynamic Values
+
+Dynamic values can be embedded in the server message replies. User can specify different variables in message strings. Variables are represented by {variable} in the string. 
+
+<DIV class="table-wrap">
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Variable Name </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> server.ip </TD>
+<TD class="confluenceTd"> Server IP address. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> server.port </TD>
+<TD class="confluenceTd"> Server port. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> client.ip </TD>
+<TD class="confluenceTd"> Client IP address. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> client.con.time </TD>
+<TD class="confluenceTd"> Client connection time. The date format is yyyy-MM-dd'T'HH:mm:ss (ISO8601). </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> client.login.time </TD>
+<TD class="confluenceTd"> Client login time. The date format is yyyy-MM-dd'T'HH:mm:ss (ISO8601). </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> client.login.name </TD>
+<TD class="confluenceTd"> User login name. If the user has not passed the login name, it will be null. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> client.access.time </TD>
+<TD class="confluenceTd"> Client last access time. The date format is yyyy-MM-ddTHH:mm:ss (ISO8601). </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> client.home </TD>
+<TD class="confluenceTd"> User home directory. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> client.dir </TD>
+<TD class="confluenceTd"> User current directory. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> request.line </TD>
+<TD class="confluenceTd"> User request line. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> request.cmd </TD>
+<TD class="confluenceTd"> User FTP command. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> request.arg </TD>
+<TD class="confluenceTd"> User request argument. If there is no argument it will be null. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> stat.start.time </TD>
+<TD class="confluenceTd"> Server start time. The date format is yyyy-MM-ddTHH:mm:ss (ISO8601). </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> stat.con.total </TD>
+<TD class="confluenceTd"> Total number of connections after server startup. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> stat.con.curr </TD>
+<TD class="confluenceTd"> Current connection number. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> stat.login.total </TD>
+<TD class="confluenceTd"> Total number of logins after server startup. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> stat.login.curr </TD>
+<TD class="confluenceTd"> Current login number. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> stat.login.anon.total </TD>
+<TD class="confluenceTd"> Total number of anonymous logins after server startup. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> stat.login.anon.curr </TD>
+<TD class="confluenceTd"> Current anonymous login number. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> stat.file.upload.count </TD>
+<TD class="confluenceTd"> Total number of files uploaded. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> stat.file.upload.bytes </TD>
+<TD class="confluenceTd"> Total number of bytes uploaded. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> stat.file.download.count </TD>
+<TD class="confluenceTd"> Total number of files downloaded </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> stat.file.download.bytes </TD>
+<TD class="confluenceTd"> Total number of bytes downloaded </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> stat.file.delete.count </TD>
+<TD class="confluenceTd"> Total number of files deleted. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> stat.dir.create.count </TD>
+<TD class="confluenceTd"> Total number of directories created. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> stat.dir.delete.count </TD>
+<TD class="confluenceTd"> Total number of directories removed. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> output.code </TD>
+<TD class="confluenceTd"> FTP Server 3 digit reply code. </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> output.msg </TD>
+<TD class="confluenceTd"> Basic core message which has to be available in the message. </TD>
+</TR>
+</TBODY></TABLE>
+</DIV>