Skip to content

Commit 3e86e80

Browse files
committed
More javadoc warning fixes
1 parent bdc3fa6 commit 3e86e80

File tree

7 files changed

+186
-51
lines changed

7 files changed

+186
-51
lines changed

core/src/main/java/org/apache/ftpserver/impl/FtpIoSession.java

Lines changed: 105 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -60,48 +60,77 @@
6060
*
6161
*/
6262
public class FtpIoSession implements IoSession {
63-
64-
/**
65-
* Contains user name between USER and PASS commands
66-
*/
63+
/// Contains user name between USER and PASS commands
64+
/** Prefix for all the attributes*/
6765
public static final String ATTRIBUTE_PREFIX = "org.apache.ftpserver.";
68-
private static final String ATTRIBUTE_USER_ARGUMENT = ATTRIBUTE_PREFIX
69-
+ "user-argument";
70-
private static final String ATTRIBUTE_SESSION_ID = ATTRIBUTE_PREFIX
71-
+ "session-id";
72-
private static final String ATTRIBUTE_USER = ATTRIBUTE_PREFIX + "user";
73-
private static final String ATTRIBUTE_LANGUAGE = ATTRIBUTE_PREFIX
74-
+ "language";
75-
private static final String ATTRIBUTE_LOGIN_TIME = ATTRIBUTE_PREFIX
76-
+ "login-time";
77-
private static final String ATTRIBUTE_DATA_CONNECTION = ATTRIBUTE_PREFIX
78-
+ "data-connection";
79-
private static final String ATTRIBUTE_FILE_SYSTEM = ATTRIBUTE_PREFIX
80-
+ "file-system";
81-
private static final String ATTRIBUTE_RENAME_FROM = ATTRIBUTE_PREFIX
82-
+ "rename-from";
83-
private static final String ATTRIBUTE_FILE_OFFSET = ATTRIBUTE_PREFIX
84-
+ "file-offset";
85-
private static final String ATTRIBUTE_DATA_TYPE = ATTRIBUTE_PREFIX
86-
+ "data-type";
87-
private static final String ATTRIBUTE_STRUCTURE = ATTRIBUTE_PREFIX
88-
+ "structure";
89-
private static final String ATTRIBUTE_FAILED_LOGINS = ATTRIBUTE_PREFIX
90-
+ "failed-logins";
91-
private static final String ATTRIBUTE_LISTENER = ATTRIBUTE_PREFIX
92-
+ "listener";
93-
private static final String ATTRIBUTE_MAX_IDLE_TIME = ATTRIBUTE_PREFIX
94-
+ "max-idle-time";
95-
private static final String ATTRIBUTE_LAST_ACCESS_TIME = ATTRIBUTE_PREFIX
96-
+ "last-access-time";
97-
private static final String ATTRIBUTE_CACHED_REMOTE_ADDRESS = ATTRIBUTE_PREFIX
98-
+ "cached-remote-address";
66+
67+
/** User argument attribute */
68+
private static final String ATTRIBUTE_USER_ARGUMENT = ATTRIBUTE_PREFIX + "user-argument";
69+
70+
/** session ID attribute */
71+
private static final String ATTRIBUTE_SESSION_ID = ATTRIBUTE_PREFIX + "session-id";
72+
73+
/** User attribute */
74+
private static final String ATTRIBUTE_USER = ATTRIBUTE_PREFIX + "user";
75+
76+
/** Language attribute */
77+
private static final String ATTRIBUTE_LANGUAGE = ATTRIBUTE_PREFIX + "language";
78+
79+
/** Login time attribute */
80+
private static final String ATTRIBUTE_LOGIN_TIME = ATTRIBUTE_PREFIX + "login-time";
81+
82+
/** Data connection attribute */
83+
private static final String ATTRIBUTE_DATA_CONNECTION = ATTRIBUTE_PREFIX + "data-connection";
84+
85+
/** File system attribute */
86+
private static final String ATTRIBUTE_FILE_SYSTEM = ATTRIBUTE_PREFIX + "file-system";
87+
88+
/** Rename from attribute */
89+
private static final String ATTRIBUTE_RENAME_FROM = ATTRIBUTE_PREFIX + "rename-from";
90+
91+
/** File offset attribute */
92+
private static final String ATTRIBUTE_FILE_OFFSET = ATTRIBUTE_PREFIX + "file-offset";
93+
94+
/** Data type attribute */
95+
private static final String ATTRIBUTE_DATA_TYPE = ATTRIBUTE_PREFIX + "data-type";
96+
97+
/** Structure attribute */
98+
private static final String ATTRIBUTE_STRUCTURE = ATTRIBUTE_PREFIX + "structure";
99+
100+
/** Failed login attribute */
101+
private static final String ATTRIBUTE_FAILED_LOGINS = ATTRIBUTE_PREFIX + "failed-logins";
102+
103+
/** Listener attribute */
104+
private static final String ATTRIBUTE_LISTENER = ATTRIBUTE_PREFIX + "listener";
105+
106+
/** Max idle time attribute */
107+
private static final String ATTRIBUTE_MAX_IDLE_TIME = ATTRIBUTE_PREFIX + "max-idle-time";
108+
109+
/** Last access time attribute */
110+
private static final String ATTRIBUTE_LAST_ACCESS_TIME = ATTRIBUTE_PREFIX + "last-access-time";
111+
112+
/** Cached remote address attribute */
113+
private static final String ATTRIBUTE_CACHED_REMOTE_ADDRESS = ATTRIBUTE_PREFIX + "cached-remote-address";
114+
115+
/** The encapsulated IoSession instance */
99116
private final IoSession wrappedSession;
117+
118+
/** The server context instance */
100119
private final FtpServerContext context;
120+
121+
/** Last reply that was sent to the client, if any. */
122+
private FtpReply lastReply = null;
123+
101124
/**
102-
* Last reply that was sent to the client, if any.
125+
* Public constructor
126+
*
127+
* @param wrappedSession The wrapped IoSession
128+
* @param context The server cobtext
103129
*/
104-
private FtpReply lastReply = null;
130+
public FtpIoSession(IoSession wrappedSession, FtpServerContext context) {
131+
this.wrappedSession = wrappedSession;
132+
this.context = context;
133+
}
105134

106135
/* Begin wrapped IoSession methods */
107136
/**
@@ -705,31 +734,51 @@ public UUID getSessionId() {
705734
}
706735
}
707736

708-
public FtpIoSession(IoSession wrappedSession, FtpServerContext context) {
709-
this.wrappedSession = wrappedSession;
710-
this.context = context;
711-
}
712-
737+
/**
738+
* Get the structure attribute. We support only <code>FILE</code>
739+
*
740+
* @return The structure attribute
741+
*/
713742
public Structure getStructure() {
714743
return (Structure) getAttribute(ATTRIBUTE_STRUCTURE, Structure.FILE);
715744
}
716745

746+
/**
747+
* Get the data type (ascii or binary)
748+
*
749+
* @return The data type
750+
*/
717751
public DataType getDataType() {
718752
return (DataType) getAttribute(ATTRIBUTE_DATA_TYPE, DataType.ASCII);
719753
}
720754

755+
/**
756+
* Get the login time
757+
*
758+
* @return The login time
759+
*/
721760
public Date getLoginTime() {
722761
return (Date) getAttribute(ATTRIBUTE_LOGIN_TIME);
723762
}
724763

764+
/**
765+
* Get the last time the session has been accessed
766+
*
767+
* @return The last access time
768+
*/
725769
public Date getLastAccessTime() {
726770
return (Date) getAttribute(ATTRIBUTE_LAST_ACCESS_TIME);
727771
}
728772

773+
/**
774+
* Get an ordered array of peer certificates, with the peer's own certificate first followed
775+
* by any certificate authorities.
776+
*
777+
* @return The client certificates
778+
*/
729779
public Certificate[] getClientCertificates() {
730780
if (getFilterChain().contains(SslFilter.class)) {
731-
SslFilter sslFilter = (SslFilter) getFilterChain().get(
732-
SslFilter.class);
781+
SslFilter sslFilter = (SslFilter) getFilterChain().get(SslFilter.class);
733782

734783
SSLSession sslSession = SSLSession.class.cast(getAttribute(SslFilter.SSL_SECURED));
735784

@@ -748,6 +797,9 @@ public Certificate[] getClientCertificates() {
748797

749798
}
750799

800+
/**
801+
* Update the last-access-time session attribute with the current date
802+
*/
751803
public void updateLastAccessTime() {
752804
setAttribute(ATTRIBUTE_LAST_ACCESS_TIME, new Date());
753805
}
@@ -799,6 +851,7 @@ public boolean isSecure() {
799851

800852
/**
801853
* Increase the number of bytes written on the data connection
854+
*
802855
* @param increment The number of bytes written
803856
*/
804857
public void increaseWrittenDataBytes(int increment) {
@@ -811,6 +864,7 @@ public void increaseWrittenDataBytes(int increment) {
811864

812865
/**
813866
* Increase the number of bytes read on the data connection
867+
*
814868
* @param increment The number of bytes written
815869
*/
816870
public void increaseReadDataBytes(int increment) {
@@ -822,6 +876,7 @@ public void increaseReadDataBytes(int increment) {
822876

823877
/**
824878
* Returns the last reply that was sent to the client.
879+
*
825880
* @return the last reply that was sent to the client.
826881
*/
827882
public FtpReply getLastReply() {
@@ -863,10 +918,16 @@ public void updateThroughput(long currentTime, boolean force) {
863918
wrappedSession.updateThroughput(currentTime, force);
864919
}
865920

921+
/**
922+
* {@inheritDoc}
923+
*/
866924
public boolean isSecured() {
867925
return getFilterChain().contains(SslFilter.class);
868926
}
869927

928+
/**
929+
* {@inheritDoc}
930+
*/
870931
@Override
871932
public boolean isServer() {
872933
return (getService() instanceof IoAcceptor);

core/src/main/java/org/apache/ftpserver/usermanager/impl/AbstractUserManager.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,34 @@
3232
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
3333
*/
3434
public abstract class AbstractUserManager implements UserManager {
35-
35+
/** 'userid' key for the variable to be injected into SQL prepared statement*/
3636
public static final String ATTR_LOGIN = "userid";
3737

38+
/** 'userpassword' key for the variable to be injected into SQL prepared statement*/
3839
public static final String ATTR_PASSWORD = "userpassword";
3940

41+
/** 'homedirectory' key for the variable to be injected into SQL prepared statement*/
4042
public static final String ATTR_HOME = "homedirectory";
4143

44+
/** 'writepermission' key for the variable to be injected into SQL prepared statement*/
4245
public static final String ATTR_WRITE_PERM = "writepermission";
4346

47+
/** 'enableflag' key for the variable to be injected into SQL prepared statement*/
4448
public static final String ATTR_ENABLE = "enableflag";
4549

50+
/** 'idletime' key for the variable to be injected into SQL prepared statement*/
4651
public static final String ATTR_MAX_IDLE_TIME = "idletime";
4752

53+
/** 'uploadrate' key for the variable to be injected into SQL prepared statement*/
4854
public static final String ATTR_MAX_UPLOAD_RATE = "uploadrate";
4955

56+
/** 'downloadrate' key for the variable to be injected into SQL prepared statement*/
5057
public static final String ATTR_MAX_DOWNLOAD_RATE = "downloadrate";
5158

59+
/** 'maxloginnumber' key for the variable to be injected into SQL prepared statement*/
5260
public static final String ATTR_MAX_LOGIN_NUMBER = "maxloginnumber";
5361

62+
/** 'maxloginperip' key for the variable to be injected into SQL prepared statement*/
5463
public static final String ATTR_MAX_LOGIN_PER_IP = "maxloginperip";
5564

5665
private final String adminName;

examples/ftpserver-example-spring-war/src/main/java/org/apache/ftpserver/example/springwar/FtpServerListener.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,22 @@
2626
import org.springframework.web.context.WebApplicationContext;
2727
import org.springframework.web.context.support.WebApplicationContextUtils;
2828

29-
/*
29+
/**
30+
* A servlet listener for the FtpServer
31+
*
3032
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
3133
*/
3234
public class FtpServerListener implements ServletContextListener {
3335
/** The context name. */
3436
public static final String FTPSERVER_CONTEXT_NAME = "org.apache.ftpserver";
3537

38+
/**
39+
* A default constructor
40+
*/
41+
public FtpServerListener() {
42+
// Do nothing
43+
}
44+
3645
/**
3746
* {@inheritDoc}
3847
*/

examples/ftpserver-example-spring-war/src/main/java/org/apache/ftpserver/example/springwar/FtpServerServlet.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,22 @@
2929

3030
import org.apache.ftpserver.FtpServer;
3131

32-
/*
32+
/**
33+
* An HttpServelt implementation for a FtpServer
34+
*
3335
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
3436
*/
3537
public class FtpServerServlet extends HttpServlet {
36-
38+
/** The serial version UID */
3739
private static final long serialVersionUID = 5539642787624981705L;
3840

41+
/**
42+
* A default constructor
43+
*/
44+
public FtpServerServlet() {
45+
// Do nothing
46+
}
47+
3948
/**
4049
* {@inheritDoc}
4150
*/

examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/MyFtplet.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,19 @@
2727
import org.apache.ftpserver.ftplet.FtpSession;
2828
import org.apache.ftpserver.ftplet.FtpletResult;
2929

30-
/*
30+
/**
31+
* An instance of FtpLet
32+
*
3133
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
3234
*/
3335
public class MyFtplet extends DefaultFtplet {
36+
/**
37+
* A default constructor
38+
*/
39+
public MyFtplet() {
40+
super();
41+
}
42+
3443
/**
3544
* {@inheritDoc}
3645
*/

examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/impl/Activator.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,19 @@
2727
import org.osgi.framework.BundleActivator;
2828
import org.osgi.framework.BundleContext;
2929

30-
/*
30+
/**
31+
* The OSGi bundle activator for the FtpLet service
32+
*
3133
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
3234
*/
3335
public class Activator implements BundleActivator {
36+
/**
37+
* A default constructor
38+
*/
39+
public Activator() {
40+
// Do nothing
41+
}
42+
3443
/**
3544
* {@inheritDoc}
3645
*/

0 commit comments

Comments
 (0)