This is an automated email from the ASF dual-hosted git repository. elecharny pushed a commit to branch 1.2.X in repository https://gitbox.apache.org/repos/asf/mina-ftpserver.git
The following commit(s) were added to refs/heads/1.2.X by this push: new 3e86e807 More javadoc warning fixes 3e86e807 is described below commit 3e86e807350c4c847e265e136e125fbaeb3bf288 Author: emmanuel lecharny <elecha...@apache.org> AuthorDate: Sun Jan 12 08:00:39 2025 +0100 More javadoc warning fixes --- .../org/apache/ftpserver/impl/FtpIoSession.java | 149 +++++++++++++++------ .../usermanager/impl/AbstractUserManager.java | 11 +- .../example/springwar/FtpServerListener.java | 11 +- .../example/springwar/FtpServerServlet.java | 13 +- .../ftpserver/example/ftpletservice/MyFtplet.java | 11 +- .../example/ftpletservice/impl/Activator.java | 11 +- .../osgiservice/impl/FtpServerLifecycle.java | 31 ++++- 7 files changed, 186 insertions(+), 51 deletions(-) diff --git a/core/src/main/java/org/apache/ftpserver/impl/FtpIoSession.java b/core/src/main/java/org/apache/ftpserver/impl/FtpIoSession.java index 0f7bb9ec..b7b33777 100644 --- a/core/src/main/java/org/apache/ftpserver/impl/FtpIoSession.java +++ b/core/src/main/java/org/apache/ftpserver/impl/FtpIoSession.java @@ -60,48 +60,77 @@ import org.slf4j.LoggerFactory; * */ public class FtpIoSession implements IoSession { - - /** - * Contains user name between USER and PASS commands - */ + /// Contains user name between USER and PASS commands + /** Prefix for all the attributes*/ public static final String ATTRIBUTE_PREFIX = "org.apache.ftpserver."; - private static final String ATTRIBUTE_USER_ARGUMENT = ATTRIBUTE_PREFIX - + "user-argument"; - private static final String ATTRIBUTE_SESSION_ID = ATTRIBUTE_PREFIX - + "session-id"; - private static final String ATTRIBUTE_USER = ATTRIBUTE_PREFIX + "user"; - private static final String ATTRIBUTE_LANGUAGE = ATTRIBUTE_PREFIX - + "language"; - private static final String ATTRIBUTE_LOGIN_TIME = ATTRIBUTE_PREFIX - + "login-time"; - private static final String ATTRIBUTE_DATA_CONNECTION = ATTRIBUTE_PREFIX - + "data-connection"; - private static final String ATTRIBUTE_FILE_SYSTEM = ATTRIBUTE_PREFIX - + "file-system"; - private static final String ATTRIBUTE_RENAME_FROM = ATTRIBUTE_PREFIX - + "rename-from"; - private static final String ATTRIBUTE_FILE_OFFSET = ATTRIBUTE_PREFIX - + "file-offset"; - private static final String ATTRIBUTE_DATA_TYPE = ATTRIBUTE_PREFIX - + "data-type"; - private static final String ATTRIBUTE_STRUCTURE = ATTRIBUTE_PREFIX - + "structure"; - private static final String ATTRIBUTE_FAILED_LOGINS = ATTRIBUTE_PREFIX - + "failed-logins"; - private static final String ATTRIBUTE_LISTENER = ATTRIBUTE_PREFIX - + "listener"; - private static final String ATTRIBUTE_MAX_IDLE_TIME = ATTRIBUTE_PREFIX - + "max-idle-time"; - private static final String ATTRIBUTE_LAST_ACCESS_TIME = ATTRIBUTE_PREFIX - + "last-access-time"; - private static final String ATTRIBUTE_CACHED_REMOTE_ADDRESS = ATTRIBUTE_PREFIX - + "cached-remote-address"; + + /** User argument attribute */ + private static final String ATTRIBUTE_USER_ARGUMENT = ATTRIBUTE_PREFIX + "user-argument"; + + /** session ID attribute */ + private static final String ATTRIBUTE_SESSION_ID = ATTRIBUTE_PREFIX + "session-id"; + + /** User attribute */ + private static final String ATTRIBUTE_USER = ATTRIBUTE_PREFIX + "user"; + + /** Language attribute */ + private static final String ATTRIBUTE_LANGUAGE = ATTRIBUTE_PREFIX + "language"; + + /** Login time attribute */ + private static final String ATTRIBUTE_LOGIN_TIME = ATTRIBUTE_PREFIX + "login-time"; + + /** Data connection attribute */ + private static final String ATTRIBUTE_DATA_CONNECTION = ATTRIBUTE_PREFIX + "data-connection"; + + /** File system attribute */ + private static final String ATTRIBUTE_FILE_SYSTEM = ATTRIBUTE_PREFIX + "file-system"; + + /** Rename from attribute */ + private static final String ATTRIBUTE_RENAME_FROM = ATTRIBUTE_PREFIX + "rename-from"; + + /** File offset attribute */ + private static final String ATTRIBUTE_FILE_OFFSET = ATTRIBUTE_PREFIX + "file-offset"; + + /** Data type attribute */ + private static final String ATTRIBUTE_DATA_TYPE = ATTRIBUTE_PREFIX + "data-type"; + + /** Structure attribute */ + private static final String ATTRIBUTE_STRUCTURE = ATTRIBUTE_PREFIX + "structure"; + + /** Failed login attribute */ + private static final String ATTRIBUTE_FAILED_LOGINS = ATTRIBUTE_PREFIX + "failed-logins"; + + /** Listener attribute */ + private static final String ATTRIBUTE_LISTENER = ATTRIBUTE_PREFIX + "listener"; + + /** Max idle time attribute */ + private static final String ATTRIBUTE_MAX_IDLE_TIME = ATTRIBUTE_PREFIX + "max-idle-time"; + + /** Last access time attribute */ + private static final String ATTRIBUTE_LAST_ACCESS_TIME = ATTRIBUTE_PREFIX + "last-access-time"; + + /** Cached remote address attribute */ + private static final String ATTRIBUTE_CACHED_REMOTE_ADDRESS = ATTRIBUTE_PREFIX + "cached-remote-address"; + + /** The encapsulated IoSession instance */ private final IoSession wrappedSession; + + /** The server context instance */ private final FtpServerContext context; + + /** Last reply that was sent to the client, if any. */ + private FtpReply lastReply = null; + /** - * Last reply that was sent to the client, if any. + * Public constructor + * + * @param wrappedSession The wrapped IoSession + * @param context The server cobtext */ - private FtpReply lastReply = null; + public FtpIoSession(IoSession wrappedSession, FtpServerContext context) { + this.wrappedSession = wrappedSession; + this.context = context; + } /* Begin wrapped IoSession methods */ /** @@ -705,31 +734,51 @@ public class FtpIoSession implements IoSession { } } - public FtpIoSession(IoSession wrappedSession, FtpServerContext context) { - this.wrappedSession = wrappedSession; - this.context = context; - } - + /** + * Get the structure attribute. We support only <code>FILE</code> + * + * @return The structure attribute + */ public Structure getStructure() { return (Structure) getAttribute(ATTRIBUTE_STRUCTURE, Structure.FILE); } + /** + * Get the data type (ascii or binary) + * + * @return The data type + */ public DataType getDataType() { return (DataType) getAttribute(ATTRIBUTE_DATA_TYPE, DataType.ASCII); } + /** + * Get the login time + * + * @return The login time + */ public Date getLoginTime() { return (Date) getAttribute(ATTRIBUTE_LOGIN_TIME); } + /** + * Get the last time the session has been accessed + * + * @return The last access time + */ public Date getLastAccessTime() { return (Date) getAttribute(ATTRIBUTE_LAST_ACCESS_TIME); } + /** + * Get an ordered array of peer certificates, with the peer's own certificate first followed + * by any certificate authorities. + * + * @return The client certificates + */ public Certificate[] getClientCertificates() { if (getFilterChain().contains(SslFilter.class)) { - SslFilter sslFilter = (SslFilter) getFilterChain().get( - SslFilter.class); + SslFilter sslFilter = (SslFilter) getFilterChain().get(SslFilter.class); SSLSession sslSession = SSLSession.class.cast(getAttribute(SslFilter.SSL_SECURED)); @@ -748,6 +797,9 @@ public class FtpIoSession implements IoSession { } + /** + * Update the last-access-time session attribute with the current date + */ public void updateLastAccessTime() { setAttribute(ATTRIBUTE_LAST_ACCESS_TIME, new Date()); } @@ -799,6 +851,7 @@ public class FtpIoSession implements IoSession { /** * Increase the number of bytes written on the data connection + * * @param increment The number of bytes written */ public void increaseWrittenDataBytes(int increment) { @@ -811,6 +864,7 @@ public class FtpIoSession implements IoSession { /** * Increase the number of bytes read on the data connection + * * @param increment The number of bytes written */ public void increaseReadDataBytes(int increment) { @@ -822,6 +876,7 @@ public class FtpIoSession implements IoSession { /** * Returns the last reply that was sent to the client. + * * @return the last reply that was sent to the client. */ public FtpReply getLastReply() { @@ -863,10 +918,16 @@ public class FtpIoSession implements IoSession { wrappedSession.updateThroughput(currentTime, force); } + /** + * {@inheritDoc} + */ public boolean isSecured() { return getFilterChain().contains(SslFilter.class); } + /** + * {@inheritDoc} + */ @Override public boolean isServer() { return (getService() instanceof IoAcceptor); diff --git a/core/src/main/java/org/apache/ftpserver/usermanager/impl/AbstractUserManager.java b/core/src/main/java/org/apache/ftpserver/usermanager/impl/AbstractUserManager.java index d209143f..5b073b4a 100644 --- a/core/src/main/java/org/apache/ftpserver/usermanager/impl/AbstractUserManager.java +++ b/core/src/main/java/org/apache/ftpserver/usermanager/impl/AbstractUserManager.java @@ -32,25 +32,34 @@ import org.apache.ftpserver.usermanager.PasswordEncryptor; * @author <a href="http://mina.apache.org">Apache MINA Project</a> */ public abstract class AbstractUserManager implements UserManager { - + /** 'userid' key for the variable to be injected into SQL prepared statement*/ public static final String ATTR_LOGIN = "userid"; + /** 'userpassword' key for the variable to be injected into SQL prepared statement*/ public static final String ATTR_PASSWORD = "userpassword"; + /** 'homedirectory' key for the variable to be injected into SQL prepared statement*/ public static final String ATTR_HOME = "homedirectory"; + /** 'writepermission' key for the variable to be injected into SQL prepared statement*/ public static final String ATTR_WRITE_PERM = "writepermission"; + /** 'enableflag' key for the variable to be injected into SQL prepared statement*/ public static final String ATTR_ENABLE = "enableflag"; + /** 'idletime' key for the variable to be injected into SQL prepared statement*/ public static final String ATTR_MAX_IDLE_TIME = "idletime"; + /** 'uploadrate' key for the variable to be injected into SQL prepared statement*/ public static final String ATTR_MAX_UPLOAD_RATE = "uploadrate"; + /** 'downloadrate' key for the variable to be injected into SQL prepared statement*/ public static final String ATTR_MAX_DOWNLOAD_RATE = "downloadrate"; + /** 'maxloginnumber' key for the variable to be injected into SQL prepared statement*/ public static final String ATTR_MAX_LOGIN_NUMBER = "maxloginnumber"; + /** 'maxloginperip' key for the variable to be injected into SQL prepared statement*/ public static final String ATTR_MAX_LOGIN_PER_IP = "maxloginperip"; private final String adminName; diff --git a/examples/ftpserver-example-spring-war/src/main/java/org/apache/ftpserver/example/springwar/FtpServerListener.java b/examples/ftpserver-example-spring-war/src/main/java/org/apache/ftpserver/example/springwar/FtpServerListener.java index 315ff38b..c1738354 100644 --- a/examples/ftpserver-example-spring-war/src/main/java/org/apache/ftpserver/example/springwar/FtpServerListener.java +++ b/examples/ftpserver-example-spring-war/src/main/java/org/apache/ftpserver/example/springwar/FtpServerListener.java @@ -26,13 +26,22 @@ import org.apache.ftpserver.FtpServer; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; -/* +/** + * A servlet listener for the FtpServer + * * @author <a href="http://mina.apache.org">Apache MINA Project</a> */ public class FtpServerListener implements ServletContextListener { /** The context name. */ public static final String FTPSERVER_CONTEXT_NAME = "org.apache.ftpserver"; + /** + * A default constructor + */ + public FtpServerListener() { + // Do nothing + } + /** * {@inheritDoc} */ diff --git a/examples/ftpserver-example-spring-war/src/main/java/org/apache/ftpserver/example/springwar/FtpServerServlet.java b/examples/ftpserver-example-spring-war/src/main/java/org/apache/ftpserver/example/springwar/FtpServerServlet.java index 15f9e937..a30e010a 100644 --- a/examples/ftpserver-example-spring-war/src/main/java/org/apache/ftpserver/example/springwar/FtpServerServlet.java +++ b/examples/ftpserver-example-spring-war/src/main/java/org/apache/ftpserver/example/springwar/FtpServerServlet.java @@ -29,13 +29,22 @@ import javax.servlet.http.HttpServletResponse; import org.apache.ftpserver.FtpServer; -/* +/** + * An HttpServelt implementation for a FtpServer + * * @author <a href="http://mina.apache.org">Apache MINA Project</a> */ public class FtpServerServlet extends HttpServlet { - + /** The serial version UID */ private static final long serialVersionUID = 5539642787624981705L; + /** + * A default constructor + */ + public FtpServerServlet() { + // Do nothing + } + /** * {@inheritDoc} */ diff --git a/examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/MyFtplet.java b/examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/MyFtplet.java index a45363a4..96d2f30f 100644 --- a/examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/MyFtplet.java +++ b/examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/MyFtplet.java @@ -27,10 +27,19 @@ import org.apache.ftpserver.ftplet.FtpException; import org.apache.ftpserver.ftplet.FtpSession; import org.apache.ftpserver.ftplet.FtpletResult; -/* +/** + * An instance of FtpLet + * * @author <a href="http://mina.apache.org">Apache MINA Project</a> */ public class MyFtplet extends DefaultFtplet { + /** + * A default constructor + */ + public MyFtplet() { + super(); + } + /** * {@inheritDoc} */ diff --git a/examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/impl/Activator.java b/examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/impl/Activator.java index eea7d5c7..22ca8aae 100644 --- a/examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/impl/Activator.java +++ b/examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/impl/Activator.java @@ -27,10 +27,19 @@ import org.apache.ftpserver.ftplet.Ftplet; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; -/* +/** + * The OSGi bundle activator for the FtpLet service + * * @author <a href="http://mina.apache.org">Apache MINA Project</a> */ public class Activator implements BundleActivator { + /** + * A default constructor + */ + public Activator() { + // Do nothing + } + /** * {@inheritDoc} */ diff --git a/examples/ftpserver-osgi-spring-service/src/main/java/org/apache/ftpserver/example/osgiservice/impl/FtpServerLifecycle.java b/examples/ftpserver-osgi-spring-service/src/main/java/org/apache/ftpserver/example/osgiservice/impl/FtpServerLifecycle.java index 14cd43bf..40022bc1 100644 --- a/examples/ftpserver-osgi-spring-service/src/main/java/org/apache/ftpserver/example/osgiservice/impl/FtpServerLifecycle.java +++ b/examples/ftpserver-osgi-spring-service/src/main/java/org/apache/ftpserver/example/osgiservice/impl/FtpServerLifecycle.java @@ -23,25 +23,54 @@ package org.apache.ftpserver.example.osgiservice.impl; import org.apache.ftpserver.FtpServer; /** + * An OSGi life cycle management class + * * @author <a href="http://mina.apache.org">Apache MINA Project</a> */ public class FtpServerLifecycle { - + /** The server to manage */ private FtpServer server; + /** + * A default constructor + */ + public FtpServerLifecycle() { + // Do nothing + } + + /** + * Get the FtpServer instance + * + * @return The FtpServer instance + */ public FtpServer getServer() { return server; } + /** + * Set the FtpServer instance + * + * @param server The FtpServer instance + */ public void setServer(FtpServer server) { this.server = server; } + /** + * Initialize the FtpServer + * + * @throws Exception If the server can't be started + */ public void init() throws Exception { server.start(); System.out.println("Server started"); } + /** + * Stop the server + * + * @throws Exception If the server can't be stopped + */ public void destroy() throws Exception { server.stop(); System.out.println("Server stopped");