Author: ngn
Date: Tue Nov  4 12:02:43 2008
New Revision: 711368

URL: http://svn.apache.org/viewvc?rev=711368&view=rev
Log:
Full Javadoc coverage fro ftplet-api module
Returning socket addresses in the session

Added:
    mina/ftpserver/trunk/ftplet-api/.checkstyle
Modified:
    
mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpSession.java
    mina/ftpserver/trunk/ftplet-api/pom.xml
    
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/AuthenticationFailedException.java
    
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DataConnection.java
    
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DefaultFtpReply.java
    
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DefaultFtplet.java
    
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileSystemFactory.java
    
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileSystemView.java
    
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpException.java
    
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpFile.java
    
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpRequest.java
    
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpSession.java
    
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpStatistics.java
    
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/Ftplet.java
    
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpletContext.java
    
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/User.java
    
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/UserManager.java

Modified: 
mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpSession.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpSession.java?rev=711368&r1=711367&r2=711368&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpSession.java
 (original)
+++ 
mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpSession.java
 Tue Nov  4 12:02:43 2008
@@ -133,10 +133,9 @@
     /**
      * Get remote address
      */
-    public InetAddress getClientAddress() {
+    public InetSocketAddress getClientAddress() {
         if (ioSession.getRemoteAddress() instanceof InetSocketAddress) {
-            return ((InetSocketAddress) ioSession.getRemoteAddress())
-                    .getAddress();
+            return ((InetSocketAddress) ioSession.getRemoteAddress());
         } else {
             return null;
         }
@@ -192,23 +191,14 @@
         return ioSession.getClientCertificates();
     }
 
-    public InetAddress getServerAddress() {
+    public InetSocketAddress getServerAddress() {
         if (ioSession.getLocalAddress() instanceof InetSocketAddress) {
-            return ((InetSocketAddress) ioSession.getLocalAddress())
-                    .getAddress();
+            return ((InetSocketAddress) ioSession.getLocalAddress());
         } else {
             return null;
         }
     }
 
-    public int getServerPort() {
-        if (ioSession.getLocalAddress() instanceof InetSocketAddress) {
-            return ((InetSocketAddress) ioSession.getLocalAddress()).getPort();
-        } else {
-            return 0;
-        }
-    }
-
     public int getFailedLogins() {
         return ioSession.getFailedLogins();
     }

Added: mina/ftpserver/trunk/ftplet-api/.checkstyle
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/.checkstyle?rev=711368&view=auto
==============================================================================
--- mina/ftpserver/trunk/ftplet-api/.checkstyle (added)
+++ mina/ftpserver/trunk/ftplet-api/.checkstyle Tue Nov  4 12:02:43 2008
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fileset-config file-format-version="1.2.0" simple-config="true">
+    <fileset name="all" enabled="true" check-config-name="Sun Checks" 
local="false">
+        <file-match-pattern match-pattern="." include-pattern="true"/>
+    </fileset>
+</fileset-config>

Modified: mina/ftpserver/trunk/ftplet-api/pom.xml
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/pom.xml?rev=711368&r1=711367&r2=711368&view=diff
==============================================================================
--- mina/ftpserver/trunk/ftplet-api/pom.xml (original)
+++ mina/ftpserver/trunk/ftplet-api/pom.xml Tue Nov  4 12:02:43 2008
@@ -25,12 +25,12 @@
        <version>1.0.0-M4-SNAPSHOT</version>
        <packaging>bundle</packaging>
        <name>Apache Ftplet API</name>
-       <description>
-         Ftplets are, similar to servlets, an API to plug into the request
-         lifecycle of FtpServer. Ftplets are called on session connect and 
disconnect
-         as well as before and after each command within a user session. 
-       </description>
-       <url>http://mina.apache.org/ftpserver</url>
+       <description> Ftplets are, similar to servlets, an API to plug into the
+               request lifecycle of FtpServer. Ftplets are called on session 
connect
+               and disconnect as well as before and after each command within 
a user
+               session.</description>
+       <url>http://mina.apache.org/ftpserver
+       </url>
        <scm>
                <connection>
                        
scm:svn:http://svn.apache.org/repos/asf/mina/ftpserver/trunk/ftplet-api
@@ -80,4 +80,4 @@
                <maven.compile.source>1.5</maven.compile.source>
                <maven.compile.target>1.5</maven.compile.target>
        </properties>
-</project>
+</project>
\ No newline at end of file

Modified: 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/AuthenticationFailedException.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/AuthenticationFailedException.java?rev=711368&r1=711367&r2=711368&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/AuthenticationFailedException.java
 (original)
+++ 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/AuthenticationFailedException.java
 Tue Nov  4 12:02:43 2008
@@ -40,7 +40,7 @@
      * message.
      * 
      * @param msg
-     *            a description of the exception
+     *            A description of the exception
      */
     public AuthenticationFailedException(String msg) {
         super(msg);
@@ -51,7 +51,7 @@
      * <code>Throwable</code> cause.
      * 
      * @param th
-     *            the original cause
+     *            The original cause
      */
     public AuthenticationFailedException(Throwable th) {
         super(th);
@@ -60,9 +60,10 @@
     /**
      * Constructs a <code>AuthenticationFailedException</code> object with a
      * <code>Throwable</code> cause.
+     * @param msg A description of the exception
      * 
      * @param th
-     *            the original cause
+     *            The original cause
      */
     public AuthenticationFailedException(String msg, Throwable th) {
         super(msg);

Modified: 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DataConnection.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DataConnection.java?rev=711368&r1=711367&r2=711368&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DataConnection.java
 (original)
+++ 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DataConnection.java
 Tue Nov  4 12:02:43 2008
@@ -32,28 +32,30 @@
 
     /**
      * Transfer data from the client (e.g. STOR).
-     * 
+     * @param session The current [EMAIL PROTECTED] FtpSession}
      * @param out
      *            The [EMAIL PROTECTED] OutputStream} containing the 
destination of the
      *            data from the client.
      * @return The length of the transferred data
      * @throws IOException
      */
-    long transferFromClient(FtpSession session, OutputStream out) throws 
IOException;
+    long transferFromClient(FtpSession session, OutputStream out)
+            throws IOException;
 
     /**
      * Transfer data to the client (e.g. RETR).
-     * 
+     * @param session The current [EMAIL PROTECTED] FtpSession}
      * @param in
      *            Data to be transfered to the client
      * @return The length of the transferred data
      * @throws IOException
      */
-    long transferToClient(FtpSession session, InputStream in) throws 
IOException;
+    long transferToClient(FtpSession session, InputStream in)
+            throws IOException;
 
     /**
      * Transfer a string to the client, e.g. during LIST
-     * 
+     * @param session The current [EMAIL PROTECTED] FtpSession}
      * @param str
      *            The string to transfer
      * @throws IOException

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=711368&r1=711367&r2=711368&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
 Tue Nov  4 12:02:43 2008
@@ -31,17 +31,23 @@
 
     private String message;
 
-    private final static String CRLF = "\r\n";
+    private static final String CRLF = "\r\n";
 
     /**
-     * @param code
-     * @param message
+     * Constructor for single-line messages
+     * @param code The reply code
+     * @param message The reply message
      */
     public DefaultFtpReply(final int code, final String message) {
         this.code = code;
         this.message = message;
     }
 
+    /**
+     * Constructor for multi-line replies
+     * @param code The reply code
+     * @param message The reply message, one line per String
+     */
     public DefaultFtpReply(final int code, final String[] message) {
         this.code = code;
 

Modified: 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DefaultFtplet.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DefaultFtplet.java?rev=711368&r1=711367&r2=711368&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DefaultFtplet.java
 (original)
+++ 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DefaultFtplet.java
 Tue Nov  4 12:02:43 2008
@@ -104,91 +104,235 @@
         }
     }
 
+    /**
+     * Override this method to intercept user logins
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onLogin(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to intercept deletions
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onDeleteStart(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to handle deletions after completion
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onDeleteEnd(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to intercept uploads
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onUploadStart(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to handle uploads after completion
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onUploadEnd(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to intercept downloads
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onDownloadStart(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to handle downloads after completion
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onDownloadEnd(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to intercept deletion of directories
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onRmdirStart(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to handle deletion of directories after completion
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onRmdirEnd(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to intercept creation of directories
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onMkdirStart(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to handle creation of directories after completion
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onMkdirEnd(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to intercept file appends
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onAppendStart(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to intercept file appends after completion
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onAppendEnd(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;
     }
 
-    public FtpletResult onUploadUniqueStart(FtpSession session, FtpRequest 
request)
-            throws FtpException, IOException {
+    /**
+     * Override this method to intercept unique uploads
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
+    public FtpletResult onUploadUniqueStart(FtpSession session,
+            FtpRequest request) throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to handle unique uploads after completion
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onUploadUniqueEnd(FtpSession session, FtpRequest 
request)
             throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to intercept renames
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onRenameStart(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to handle renames after completion
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onRenameEnd(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;
     }
 
+    /**
+     * Override this method to intercept SITE commands
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @param request The current [EMAIL PROTECTED] FtpRequest}
+     * @return The action for the container to take
+     * @throws FtpException
+     * @throws IOException
+     */
     public FtpletResult onSite(FtpSession session, FtpRequest request)
             throws FtpException, IOException {
         return null;

Modified: 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileSystemFactory.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileSystemFactory.java?rev=711368&r1=711367&r2=711368&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileSystemFactory.java
 (original)
+++ 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileSystemFactory.java
 Tue Nov  4 12:02:43 2008
@@ -29,6 +29,9 @@
 
     /**
      * Create user specific file system view.
+     * @param user The user for which the file system should be created
+     * @return The current [EMAIL PROTECTED] FileSystemView} for the provided 
user
+     * @throws FtpException 
      */
     FileSystemView createFileSystemView(User user) throws FtpException;
 

Modified: 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileSystemView.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileSystemView.java?rev=711368&r1=711367&r2=711368&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileSystemView.java
 (original)
+++ 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileSystemView.java
 Tue Nov  4 12:02:43 2008
@@ -29,26 +29,38 @@
 
     /**
      * Get the user home directory.
+     * @return The [EMAIL PROTECTED] FtpFile} for the users home directory
+     * @throws FtpException 
      */
     FtpFile getHomeDirectory() throws FtpException;
 
     /**
      * Get user current directory.
+     * @return The [EMAIL PROTECTED] FtpFile} for the users current directory
+     * @throws FtpException 
      */
     FtpFile getWorkingDirectory() throws FtpException;
 
     /**
      * Change directory.
+     * @param dir The path of the directory to set as the current directory 
for the user
+     * @return true if successful
+     * @throws FtpException 
      */
     boolean changeWorkingDirectory(String dir) throws FtpException;
 
     /**
      * Get file object.
+     * @param file The path to the file to get
+     * @return The [EMAIL PROTECTED] FtpFile} for the provided path
+     * @throws FtpException 
      */
     FtpFile getFile(String file) throws FtpException;
 
     /**
      * Does the file system support random file access?
+     * @return true if the file supports random access
+     * @throws FtpException 
      */
     boolean isRandomAccessible() throws FtpException;
 

Modified: 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpException.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpException.java?rev=711368&r1=711367&r2=711368&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpException.java
 (original)
+++ 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpException.java
 Tue Nov  4 12:02:43 2008
@@ -66,9 +66,10 @@
     /**
      * Constructs a <code>BaseException</code> object with a
      * <code>Throwable</code> cause.
+     * @param msg A description of the exception
      * 
      * @param th
-     *            the original cause
+     *            The original cause
      */
     public FtpException(String msg, Throwable th) {
         super(msg);
@@ -77,6 +78,7 @@
 
     /**
      * Get the root cause.
+     * @return The root cause
      */
     public Throwable getRootCause() {
         return throwable;

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=711368&r1=711367&r2=711368&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
 Tue Nov  4 12:02:43 2008
@@ -47,76 +47,92 @@
 
     /**
      * Is the file hidden?
+     * @return true if the [EMAIL PROTECTED] FtpFile} is hidden
      */
     boolean isHidden();
 
     /**
      * Is it a directory?
+     * @return true if the [EMAIL PROTECTED] FtpFile} is a directory
      */
     boolean isDirectory();
 
     /**
      * Is it a file?
+     * @return true if the [EMAIL PROTECTED] FtpFile} is a file, false if it 
is a directory
      */
     boolean isFile();
 
     /**
      * Does this file exists?
+     * @return true if the [EMAIL PROTECTED] FtpFile} exists
      */
     boolean doesExist();
 
     /**
      * Has read permission?
+     * @return true if the [EMAIL PROTECTED] FtpFile} is readable by the user
      */
     boolean isReadable();
 
     /**
      * Has write permission?
+     * @return true if the [EMAIL PROTECTED] FtpFile} is writable by the user
      */
     boolean isWritable();
 
     /**
      * Has delete permission?
+     * @return true if the [EMAIL PROTECTED] FtpFile} is removable by the user
      */
     boolean isRemovable();
 
     /**
      * Get the owner name.
+     * @return The name of the owner of the [EMAIL PROTECTED] FtpFile}
      */
     String getOwnerName();
 
     /**
      * Get owner group name.
+     * @return The name of the group that owns the [EMAIL PROTECTED] FtpFile}
      */
     String getGroupName();
 
     /**
      * Get link count.
+     * @return The number of links for the [EMAIL PROTECTED] FtpFile}
      */
     int getLinkCount();
 
     /**
      * Get last modified time.
+     * @return The timestamp of the last modified time for the [EMAIL 
PROTECTED] FtpFile}
      */
     long getLastModified();
 
     /**
      * Get file size.
+     * @return The size of the [EMAIL PROTECTED] FtpFile} in bytes
      */
     long getSize();
 
     /**
      * Create directory.
+     * @return true if the operation was successful
      */
     boolean mkdir();
 
     /**
      * Delete file.
+     * @return true if the operation was successful
      */
     boolean delete();
 
     /**
      * Move file.
+     * @param destination The target [EMAIL PROTECTED] FtpFile} to move the 
current [EMAIL PROTECTED] FtpFile} to
+     * @return true if the operation was successful
      */
     boolean move(FtpFile destination);
 
@@ -124,18 +140,27 @@
      * List file objects. If not a directory or does not exist, null will be
      * returned. Files must be returned in alphabetical order.
      * List must be immutable.
+     * @return The [EMAIL PROTECTED] List} of [EMAIL PROTECTED] FtpFile}s
      */
     List<FtpFile> listFiles();
 
     /**
-     * Create output stream for writing. If the file is not random accessible,
-     * any offset other than zero will throw an exception.
+     * Create output stream for writing. 
+     * @param offset The number of bytes at where to start writing.
+     *      If the file is not random accessible,
+     *      any offset other than zero will throw an exception.
+     * @return An [EMAIL PROTECTED] OutputStream} used to write to the [EMAIL 
PROTECTED] FtpFile}
+     * @throws IOException 
      */
     OutputStream createOutputStream(long offset) throws IOException;
 
     /**
-     * Create input stream for reading. If the file is not random accessible,
-     * any offset other than zero will throw an exception.
+     * Create input stream for reading. 
+     * @param offset The number of bytes of where to start reading. 
+     *          If the file is not random accessible,
+     *          any offset other than zero will throw an exception.
+     * @return An [EMAIL PROTECTED] InputStream} used to read the [EMAIL 
PROTECTED] FtpFile}
+     * @throws IOException 
      */
     InputStream createInputStream(long offset) throws IOException;
 }

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=711368&r1=711367&r2=711368&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
 Tue Nov  4 12:02:43 2008
@@ -29,16 +29,19 @@
 
     /**
      * Get the client request string.
+     * @return The full request line, e.g. "MKDIR newdir"
      */
     String getRequestLine();
 
     /**
      * Returns the ftp request command.
+     * @return The command part of the request line, e.g. "MKDIR"
      */
     String getCommand();
 
     /**
      * Get the ftp request argument.
+     * @return The argument part of the request line, e.g. "newdir"
      */
     String getArgument();
 

Modified: 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpSession.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpSession.java?rev=711368&r1=711367&r2=711368&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpSession.java
 (original)
+++ 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpSession.java
 Tue Nov  4 12:02:43 2008
@@ -20,6 +20,7 @@
 package org.apache.ftpserver.ftplet;
 
 import java.net.InetAddress;
+import java.net.InetSocketAddress;
 import java.security.cert.Certificate;
 import java.util.Date;
 
@@ -37,37 +38,49 @@
 
     /**
      * Returns the IP address of the client that sent the request.
+     * @return The client [EMAIL PROTECTED] InetAddress}
      */
-    InetAddress getClientAddress();
+    InetSocketAddress getClientAddress();
 
-    InetAddress getServerAddress();
-
-    int getServerPort();
+    /**
+     * Returns the IP address of the server
+     * @return The server [EMAIL PROTECTED] InetAddress}
+     */
+    InetSocketAddress getServerAddress();
 
     /**
-     * Get FTP data connection.
+     * Get FTP data connection factory, used to transfer data to and from the 
client.
+     * @return The [EMAIL PROTECTED] DataConnectionFactory}
      */
     DataConnectionFactory getDataConnection();
 
+    /**
+     * Retrieve the certificates for the client, if running over SSL and with 
client authentication
+     * @return The Certificate chain, or null if the certificates are not 
avialble
+     */
     Certificate[] getClientCertificates();
 
     /**
      * Get connection time.
+     * @return Time when the client connected to the server
      */
     Date getConnectionTime();
 
     /**
      * Get the login time.
+     * @return Time when the client logged into the server
      */
     Date getLoginTime();
 
     /**
-     * Get the number of failed logins. When login succeeds, this will return 
0.
+     * Get the number of failed logins. 
+     * @return The number of failed logins. When login succeeds, this will 
return 0.
      */
     int getFailedLogins();
 
     /**
      * Get last access time.
+     * @return The last time the session performed any action
      */
     Date getLastAccessTime();
 
@@ -75,6 +88,7 @@
      * Returns maximum idle time. This time equals to
      * [EMAIL PROTECTED] ConnectionManagerImpl#getDefaultIdleSec()} until user 
login, and
      * [EMAIL PROTECTED] User#getMaxIdleTime()} after user login.
+     * @return The number of seconds the client is allowed to be idle before 
disconnected.
      */
     int getMaxIdleTime();
 
@@ -82,11 +96,13 @@
      * Set maximum idle time in seconds. This time equals to
      * [EMAIL PROTECTED] ConnectionManagerImpl#getDefaultIdleSec()} until user 
login, and
      * [EMAIL PROTECTED] User#getMaxIdleTime()} after user login.
+     * @param maxIdleTimeSec The number of seconds the client is allowed to be 
idle before disconnected.
      */
     void setMaxIdleTime(int maxIdleTimeSec);
 
     /**
      * Get user object.
+     * @return The current [EMAIL PROTECTED] User}
      */
     User getUser();
 
@@ -99,41 +115,50 @@
 
     /**
      * Get the requested language.
+     * @return The language requested by the client
      */
     String getLanguage();
 
     /**
      * Is the user logged in?
+     * @return true if the user is logged in
      */
     boolean isLoggedIn();
 
     /**
      * Get user file system view.
+     * @return The [EMAIL PROTECTED] FileSystemView} for this session/user
      */
     FileSystemView getFileSystemView();
 
     /**
      * Get file upload/download offset.
+     * @return The current file transfer offset, or 0 if non is set
      */
     long getFileOffset();
 
     /**
      * Get rename from file object.
+     * @return The current rename from, or null if non is set
      */
     FtpFile getRenameFrom();
 
     /**
      * Get the data type.
+     * @return The current [EMAIL PROTECTED] DataType} for this session
      */
     DataType getDataType();
 
     /**
      * Get structure.
+     * @return The current [EMAIL PROTECTED] Structure} for this session
      */
     Structure getStructure();
 
     /**
-     * Returns the value of the named attribute as an Object, or null if no
+     * Returns the value of the named attribute as an Object.
+     * @param name The attribute name
+     * @return The attribute value, or null if no
      * attribute of the given name exists.
      */
     Object getAttribute(String name);
@@ -141,11 +166,14 @@
     /**
      * Stores an attribute in this request. It will be available until it was
      * removed or when the connection ends.
+     * @param name The attribute name
+     * @param value The attribute value
      */
     void setAttribute(String name, Object value);
 
     /**
      * Removes an attribute from this request.
+     * @param name The attribute name
      */
     void removeAttribute(String name);
 

Modified: 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpStatistics.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpStatistics.java?rev=711368&r1=711367&r2=711368&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpStatistics.java
 (original)
+++ 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpStatistics.java
 Tue Nov  4 12:02:43 2008
@@ -32,81 +32,98 @@
 
     /**
      * Get the server start time.
+     * @return The [EMAIL PROTECTED] Date} when the server started
      */
     Date getStartTime();
 
     /**
      * Get number of files uploaded.
+     * @return The total number of uploads
      */
     int getTotalUploadNumber();
 
     /**
      * Get number of files downloaded.
+     * @return The total number of downloads
      */
     int getTotalDownloadNumber();
 
     /**
      * Get number of files deleted.
+     * @return The total number of deletions
      */
     int getTotalDeleteNumber();
 
     /**
      * Get total number of bytes uploaded.
+     * @return The total number of bytes uploaded
      */
     long getTotalUploadSize();
 
     /**
      * Get total number of bytes downloaded.
+     * @return The total number of bytes downloaded
      */
     long getTotalDownloadSize();
 
     /**
      * Get total directory created.
+     * @return The total number of created directories
      */
     int getTotalDirectoryCreated();
 
     /**
      * Get total directory removed.
+     * @return The total number of removed directories
      */
     int getTotalDirectoryRemoved();
 
     /**
      * Get total number of connections
+     * @return The total number of connections
      */
     int getTotalConnectionNumber();
 
     /**
      * Get current number of connections.
+     * @return The current number of connections
      */
     int getCurrentConnectionNumber();
 
     /**
      * Get total login number.
+     * @return The total number of logins
      */
     int getTotalLoginNumber();
 
     /**
      * Get total failed login number.
+     * @return The total number of failed logins
      */
     int getTotalFailedLoginNumber();
 
     /**
      * Get current login number
+     * @return The current number of logins
      */
     int getCurrentLoginNumber();
 
     /**
      * Get total anonymous login number.
+     * @return The total number of anonymous logins
      */
     int getTotalAnonymousLoginNumber();
 
     /**
      * Get current anonymous login number.
+     * @return The current number of anonymous logins
      */
     int getCurrentAnonymousLoginNumber();
 
     /**
      * Get the login number for the specific user
+     * @param user The [EMAIL PROTECTED] User} for which to retrieve the 
number of logins
+     * @return The total number of logins for the provided user
      */
     int getCurrentUserLoginNumber(User user);
 
@@ -117,6 +134,7 @@
      *            login user account
      * @param ipAddress
      *            the ip address of the remote user
+     * @return The total number of logins for the provided user and IP address
      */
     int getCurrentUserLoginNumber(User user, InetAddress ipAddress);
 }

Modified: 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/Ftplet.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/Ftplet.java?rev=711368&r1=711367&r2=711368&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/Ftplet.java
 (original)
+++ 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/Ftplet.java
 Tue Nov  4 12:02:43 2008
@@ -54,6 +54,8 @@
      * being placed into service. The ftplet container calls the init method
      * exactly once after instantiating the ftplet. The init method must
      * complete successfully before the ftplet can receive any requests.
+     * @param ftpletContext The current [EMAIL PROTECTED] FtpletContext}
+     * @throws FtpException 
      */
     void init(FtpletContext ftpletContext) throws FtpException;
 
@@ -122,11 +124,19 @@
 
     /**
      * Client connect notification method.
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @return The desired action to be performed by the server
+     * @throws FtpException 
+     * @throws IOException 
      */
     FtpletResult onConnect(FtpSession session) throws FtpException, 
IOException;
 
     /**
      * Client disconnect notification method. This is the last callback method.
+     * @param session The current [EMAIL PROTECTED] FtpSession}
+     * @return The desired action to be performed by the server
+     * @throws FtpException 
+     * @throws IOException 
      */
     FtpletResult onDisconnect(FtpSession session) throws FtpException,
             IOException;

Modified: 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpletContext.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpletContext.java?rev=711368&r1=711367&r2=711368&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpletContext.java
 (original)
+++ 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpletContext.java
 Tue Nov  4 12:02:43 2008
@@ -31,21 +31,26 @@
 
     /**
      * Get the user manager.
+     * @return The [EMAIL PROTECTED] UserManager}
      */
     UserManager getUserManager();
 
     /**
      * Get file system manager
+     * @return The [EMAIL PROTECTED] FileSystemFactory}
      */
     FileSystemFactory getFileSystemManager();
 
     /**
      * Get ftp statistics.
+     * @return The [EMAIL PROTECTED] FtpStatistics}
      */
     FtpStatistics getFtpStatistics();
 
     /**
      * Get Ftplet.
+     * @param name The name identifying the [EMAIL PROTECTED] Ftplet}
+     * @return The [EMAIL PROTECTED] Ftplet} registred with the provided name, 
or null if none exists
      */
     Ftplet getFtplet(String name);
 }

Modified: 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/User.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/User.java?rev=711368&r1=711367&r2=711368&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/User.java
 (original)
+++ 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/User.java
 Tue Nov  4 12:02:43 2008
@@ -31,15 +31,17 @@
 
     /**
      * Get the user name.
+     * @return The user name, the same used for login
      */
     String getName();
 
     /**
-     * Get password. Might return null if the user manager can not provide the 
password
+     * Get password.
+     * @return The users password or null if the user manager can not provide 
the password 
      */
     String getPassword();
 
-    /**
+    /** 
      * Get all authorities granted to this user
      * 
      * @return All authorities
@@ -55,7 +57,7 @@
 
     /**
      * Authorize a [EMAIL PROTECTED] AuthorizationRequest} for this user
-     * 
+     *
      * @param request
      *            The [EMAIL PROTECTED] AuthorizationRequest} to authorize
      * @return A populated AuthorizationRequest if the user was authorized, 
null
@@ -66,33 +68,19 @@
     /**
      * Get the maximum idle time in seconds. Zero or less idle time means no
      * limit.
+     * @return The idle time in seconds
      */
     int getMaxIdleTime();
 
     /**
      * Get the user enable status.
+     * @return true if the user is enabled
      */
     boolean getEnabled();
 
     /**
-     * Get maximum user upload rate in bytes/sec. Zero or less means no limit.
-     */
-    // int getMaxUploadRate();
-    /**
-     * Get maximum user download rate in bytes/sec. Zero or less means no 
limit.
-     */
-    // int getMaxDownloadRate();
-    /**
-     * Get maximum login number allowed for this user account
-     */
-    // int getMaxLoginNumber();
-    /**
-     * Get maximum login number allowed from the same IP address when using 
this
-     * user account
-     */
-    // int getMaxLoginPerIP();
-    /**
-     * get user home directory
+     * gGet the user home directory
+     * @return The path to the home directory for the user
      */
     String getHomeDirectory();
 }

Modified: 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/UserManager.java
URL: 
http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/UserManager.java?rev=711368&r1=711367&r2=711368&view=diff
==============================================================================
--- 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/UserManager.java
 (original)
+++ 
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/UserManager.java
 Tue Nov  4 12:02:43 2008
@@ -48,6 +48,7 @@
 
     /**
      * Delete the user from the system.
+     * @param username The name of the [EMAIL PROTECTED] User} to delete
      *
      * @throws FtpException when the UserManager can't fulfill the request.
      * @throws UnsupportedOperationException
@@ -69,14 +70,16 @@
      * Check if the user exists.
      * @param username the name of the user to check.
      * @return true if the user exist, false otherwise.
+     * @throws FtpException 
      */
     boolean doesExist(String username) throws FtpException;
 
     /**
      * Authenticate user
+     * @param authentication The [EMAIL PROTECTED] Authentication} that proves 
the users identity
+     * @return the authenticated account.
+     * @throws AuthenticationFailedException 
      * @throws FtpException when the UserManager can't fulfill the request.
-     * @param authentication
-     * @return the autheticated account.
      */
     User authenticate(Authentication authentication)
             throws AuthenticationFailedException;
@@ -90,6 +93,7 @@
 
     /**
      * Check if the user is admin.
+     * @param username The name of the [EMAIL PROTECTED] User} to check
      * @return true if user with this login is administrator
      * @throws FtpException when the UserManager can't fulfill the request.
      */


Reply via email to