Fixed some checkstyle violations
diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml
index e62645c..2fc6328 100644
--- a/checkstyle-suppressions.xml
+++ b/checkstyle-suppressions.xml
@@ -24,4 +24,5 @@
<suppress checks="RedundantModifier" files="ConstructorUtilsTest" lines="0-99999"/>
<!-- Windows-only workaround -->
<suppress checks="NewlineAtEndOfFile" files="target[/\\]maven-archiver[/\\]pom.properties"/>
+ <suppress checks="FinalParametersCheck" files=".*"/>
</suppressions>
diff --git a/checkstyle.xml b/checkstyle.xml
index d3e35d0..864649b 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -24,23 +24,34 @@
<module name="Checker">
<property name="localeLanguage" value="en"/>
<module name="JavadocPackage"/>
+
<module name="LineLength">
+ <property name="fileExtensions" value="java"/>
<property name="max" value="120"/>
</module>
+
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf" />
</module>
+
<module name="FileTabCharacter">
<property name="fileExtensions" value="java,xml"/>
</module>
+
<module name="RegexpSingleline">
<!-- \s matches whitespace character, $ matches end of line. -->
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing spaces."/>
</module>
+
<module name="SuppressionFilter">
<property name="file" value="checkstyle-suppressions.xml"/>
</module>
+
+ <module name="FinalParameters">
+ <property name="ignorePrimitiveTypes" value="true"/>
+ </module>
+
<module name="TreeWalker">
<module name="AvoidStarImport"/>
<module name="IllegalImport"/>
@@ -61,3 +72,4 @@
<module name="NoWhitespaceBefore"/>
</module>
</module>
+
diff --git a/core/src/main/java/org/apache/ftpserver/ConnectionConfig.java b/core/src/main/java/org/apache/ftpserver/ConnectionConfig.java
index 6a1869c..3ad14c8 100644
--- a/core/src/main/java/org/apache/ftpserver/ConnectionConfig.java
+++ b/core/src/main/java/org/apache/ftpserver/ConnectionConfig.java
@@ -21,7 +21,7 @@
/**
* Interface for providing the configuration for the control socket connections.
- *
+ *
*
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*
@@ -29,27 +29,27 @@
public interface ConnectionConfig {
/**
- * The maximum number of time an user can fail to login before getting disconnected
+ * The maximum number of time an user can fail to login before getting disconnected.
* @return The maximum number of failure login attempts
*/
int getMaxLoginFailures();
/**
- * The delay in number of milliseconds between login failures. Important to
+ * The delay in number of milliseconds between login failures. Important to
* make brute force attacks harder.
- *
+ *
* @return The delay time in milliseconds
*/
int getLoginFailureDelay();
/**
- * The maximum number of time an anonymous user can fail to login before getting disconnected
+ * The maximum number of time an anonymous user can fail to login before getting disconnected.
* @return The maximum number of failer login attempts
*/
int getMaxAnonymousLogins();
/**
- * The maximum number of concurrently logged in users
+ * The maximum number of concurrently logged in users.
* @return The maximum number of users
*/
int getMaxLogins();
@@ -59,11 +59,11 @@
* @return true if anonymous logins are enabled
*/
boolean isAnonymousLoginEnabled();
-
+
/**
* Returns the maximum number of threads the server is allowed to create for
* processing client requests.
- *
+ *
* @return the maximum number of threads the server is allowed to create for
* processing client requests.
*/
diff --git a/core/src/main/java/org/apache/ftpserver/impl/DefaultDataConnectionConfiguration.java b/core/src/main/java/org/apache/ftpserver/impl/DefaultDataConnectionConfiguration.java
index a1e3c0d..8f84eae 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/DefaultDataConnectionConfiguration.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/DefaultDataConnectionConfiguration.java
@@ -25,7 +25,7 @@
/**
* <strong>Internal class, do not use directly.</strong>
- *
+ *
* Data connection configuration.
*
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
@@ -41,12 +41,12 @@
private final String activeLocalAddress;
private final int activeLocalPort;
private final boolean activeIpCheck;
-
+
private final String passiveAddress;
private final String passiveExternalAddress;
private final PassivePorts passivePorts;
private final boolean passiveIpCheck;
-
+
private final boolean implicitSsl;
/**
@@ -119,11 +119,11 @@
public String getPassiveExernalAddress() {
return passiveExternalAddress;
}
-
+
public boolean isPassiveIpCheck() {
return passiveIpCheck;
}
-
+
/**
* Get passive data port. Data port number zero (0) means that any available
* port will be used.
@@ -134,7 +134,7 @@
/**
* Retrive the passive ports configured for this data connection
- *
+ *
* @return The String of passive ports
*/
public String getPassivePorts() {
diff --git a/core/src/main/java/org/apache/ftpserver/impl/ServerFtpStatistics.java b/core/src/main/java/org/apache/ftpserver/impl/ServerFtpStatistics.java
index a174ed0..cd654f3 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/ServerFtpStatistics.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/ServerFtpStatistics.java
@@ -24,7 +24,7 @@
/**
* <strong>Internal class, do not use directly.</strong>
- *
+ *
* This is same as <code>org.apache.ftpserver.ftplet.FtpStatistics</code> with
* added observer and setting values functionalities.
*
diff --git a/core/src/main/java/org/apache/ftpserver/util/StringUtils.java b/core/src/main/java/org/apache/ftpserver/util/StringUtils.java
index a863599..8642079 100644
--- a/core/src/main/java/org/apache/ftpserver/util/StringUtils.java
+++ b/core/src/main/java/org/apache/ftpserver/util/StringUtils.java
@@ -23,7 +23,7 @@
/**
* <strong>Internal class, do not use directly.</strong>
- *
+ *
* String utility methods.
*
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
@@ -33,7 +33,7 @@
/**
* This is a string replacement method.
*/
- public final static String replaceString(String source, String oldStr,
+ public static final String replaceString(String source, String oldStr,
String newStr) {
StringBuilder sb = new StringBuilder(source.length());
int sind = 0;
@@ -48,9 +48,9 @@
}
/**
- * Replace string
+ * Replace string.
*/
- public final static String replaceString(String source, Object[] args) {
+ public static final String replaceString(String source, Object[] args) {
int startIndex = 0;
int openIndex = source.indexOf('{', startIndex);
if (openIndex == -1) {
@@ -89,7 +89,7 @@
/**
* Replace string.
*/
- public final static String replaceString(String source,
+ public static final String replaceString(String source,
Map<String, Object> args) {
int startIndex = 0;
int openIndex = source.indexOf('{', startIndex);
@@ -129,15 +129,15 @@
}
/**
- * This method is used to insert HTML block dynamically
+ * This method is used to insert HTML block dynamically.
*
* @param source the HTML code to be processes
* @param bReplaceNl if true '\n' will be replaced by <br>
- * @param bReplaceTag if true '<' will be replaced by < and
+ * @param bReplaceTag if true '<' will be replaced by < and
* '>' will be replaced by >
- * @param bReplaceQuote if true '\"' will be replaced by "
+ * @param bReplaceQuote if true '\"' will be replaced by "
*/
- public final static String formatHtml(String source, boolean bReplaceNl,
+ public static final String formatHtml(String source, boolean bReplaceNl,
boolean bReplaceTag, boolean bReplaceQuote) {
StringBuilder sb = new StringBuilder();
@@ -145,57 +145,65 @@
for (int i = 0; i < len; i++) {
char c = source.charAt(i);
switch (c) {
- case '\"':
- if (bReplaceQuote)
- sb.append(""");
- else
+ case '\"':
+ if (bReplaceQuote) {
+ sb.append(""");
+ } else {
+ sb.append(c);
+ }
+
+ break;
+
+ case '<':
+ if (bReplaceTag) {
+ sb.append("<");
+ } else {
+ sb.append(c);
+ }
+
+ break;
+
+ case '>':
+ if (bReplaceTag) {
+ sb.append(">");
+ } else {
+ sb.append(c);
+ }
+
+ break;
+
+ case '\n':
+ if (bReplaceNl) {
+ if (bReplaceTag) {
+ sb.append("<br>");
+ } else {
+ sb.append("<br>");
+ }
+ } else {
+ sb.append(c);
+ }
+
+ break;
+
+ case '\r':
+ break;
+
+ case '&':
+ sb.append("&");
+ break;
+
+ default:
sb.append(c);
- break;
-
- case '<':
- if (bReplaceTag)
- sb.append("<");
- else
- sb.append(c);
- break;
-
- case '>':
- if (bReplaceTag)
- sb.append(">");
- else
- sb.append(c);
- break;
-
- case '\n':
- if (bReplaceNl) {
- if (bReplaceTag)
- sb.append("<br>");
- else
- sb.append("<br>");
- } else {
- sb.append(c);
- }
- break;
-
- case '\r':
- break;
-
- case '&':
- sb.append("&");
- break;
-
- default:
- sb.append(c);
- break;
+ break;
}
}
return sb.toString();
}
/**
- * Pad string object
+ * Pad string object.
*/
- public final static String pad(String src, char padChar, boolean rightPad,
+ public static final String pad(String src, char padChar, boolean rightPad,
int totalLength) {
int srcLength = src.length();
@@ -217,9 +225,9 @@
}
/**
- * Get hex string from byte array
+ * Get hex string from byte array.
*/
- public final static String toHexString(byte[] res) {
+ public static final String toHexString(byte[] res) {
StringBuilder sb = new StringBuilder(res.length << 1);
for (int i = 0; i < res.length; i++) {
String digit = Integer.toHexString(0xFF & res[i]);
@@ -232,9 +240,9 @@
}
/**
- * Get byte array from hex string
+ * Get byte array from hex string.
*/
- public final static byte[] toByteArray(String hexString) {
+ public static final byte[] toByteArray(String hexString) {
int arrLength = hexString.length() >> 1;
byte buff[] = new byte[arrLength];
for (int i = 0; i < arrLength; i++) {
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 8277904..c42782e 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
@@ -30,35 +30,42 @@
* @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";
-
+
+ /**
+ * {@inheritDoc}
+ */
public void contextDestroyed(ServletContextEvent sce) {
System.out.println("Stopping FtpServer");
-
- FtpServer server = (FtpServer) sce.getServletContext().getAttribute(FTPSERVER_CONTEXT_NAME);
-
- if(server != null) {
+
+ FtpServer server = (FtpServer) sce.getServletContext().
+ getAttribute(FTPSERVER_CONTEXT_NAME);
+
+ if (server != null) {
server.stop();
-
+
sce.getServletContext().removeAttribute(FTPSERVER_CONTEXT_NAME);
-
+
System.out.println("FtpServer stopped");
} else {
System.out.println("No running FtpServer found");
}
-
}
+ /**
+ * {@inheritDoc}
+ */
public void contextInitialized(ServletContextEvent sce) {
- System.out.println("Starting FtpServer");
+ System.out.println("Starting FtpServer");
- WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(sce.getServletContext());
-
+ WebApplicationContext ctx = WebApplicationContextUtils.
+ getWebApplicationContext(sce.getServletContext());
+
FtpServer server = (FtpServer) ctx.getBean("myServer");
-
+
sce.getServletContext().setAttribute(FTPSERVER_CONTEXT_NAME, server);
-
+
try {
server.start();
System.out.println("FtpServer started");
@@ -66,5 +73,5 @@
throw new RuntimeException("Failed to start FtpServer", e);
}
}
-
}
+
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 6c01ab4..15f9e93 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
@@ -36,14 +36,18 @@
private static final long serialVersionUID = 5539642787624981705L;
+ /**
+ * {@inheritDoc}
+ */
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
-
- FtpServer server = (FtpServer) getServletContext().getAttribute(FtpServerListener.FTPSERVER_CONTEXT_NAME);
-
+
+ FtpServer server = (FtpServer) getServletContext().
+ getAttribute(FtpServerListener.FTPSERVER_CONTEXT_NAME);
+
PrintWriter wr = resp.getWriter();
-
+
wr.print("<html>");
wr.print("<head>");
wr.print("<title>FtpServer status servlet</title>");
@@ -52,10 +56,10 @@
wr.print("<form method='post'>");
- if(server.isStopped()) {
+ if (server.isStopped()) {
wr.print("<p>FtpServer is stopped.</p>");
} else {
- if(server.isSuspended()) {
+ if (server.isSuspended()) {
wr.print("<p>FtpServer is suspended.</p>");
wr.print("<p><input type='submit' name='resume' value='Resume'></p>");
wr.print("<p><input type='submit' name='stop' value='Stop'></p>");
@@ -65,27 +69,31 @@
wr.print("<p><input type='submit' name='stop' value='Stop'></p>");
}
}
-
+
wr.print("</form>");
wr.print("</body>");
wr.print("</html>");
}
+ /**
+ * {@inheritDoc}
+ */
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
-
- FtpServer server = (FtpServer) getServletContext().getAttribute(FtpServerListener.FTPSERVER_CONTEXT_NAME);
-
- if(req.getParameter("stop") != null) {
+
+ FtpServer server = (FtpServer) getServletContext().
+ getAttribute(FtpServerListener.FTPSERVER_CONTEXT_NAME);
+
+ if (req.getParameter("stop") != null) {
server.stop();
- } else if(req.getParameter("resume") != null) {
+ } else if (req.getParameter("resume") != null) {
server.resume();
- } else if(req.getParameter("suspend") != null) {
+ } else if (req.getParameter("suspend") != null) {
server.suspend();
}
-
+
resp.sendRedirect("/");
}
-
}
+
diff --git a/examples/ftpserver-example-spring-war/src/main/java/org/apache/ftpserver/example/springwar/package-info.java b/examples/ftpserver-example-spring-war/src/main/java/org/apache/ftpserver/example/springwar/package-info.java
new file mode 100644
index 0000000..74090ed
--- /dev/null
+++ b/examples/ftpserver-example-spring-war/src/main/java/org/apache/ftpserver/example/springwar/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/**
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ */
+package org.apache.ftpserver.example.springwar;
diff --git a/examples/ftpserver-example-spring-war/src/main/resources/log4j.properties b/examples/ftpserver-example-spring-war/src/main/resources/log4j.properties
index b6fb474..a78bf64 100644
--- a/examples/ftpserver-example-spring-war/src/main/resources/log4j.properties
+++ b/examples/ftpserver-example-spring-war/src/main/resources/log4j.properties
@@ -15,8 +15,8 @@
# specific language governing permissions and limitations
# under the License.
-log4j.rootLogger=DEBUG, C
-log4j.appender.C=org.apache.log4j.ConsoleAppender
-log4j.appender.C.layout=org.apache.log4j.PatternLayout
+log4j.rootLogger=DEBUG, C
+log4j.appender.C=org.apache.log4j.ConsoleAppender
+log4j.appender.C.layout=org.apache.log4j.PatternLayout
log4j.appender.C.layout.ConversionPattern=[%5p] %d [%X{userName}] [%X{remoteIp}] %m%n
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 d5b6322..a45363a 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
@@ -31,23 +31,25 @@
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public class MyFtplet extends DefaultFtplet {
-
+ /**
+ * {@inheritDoc}
+ */
@Override
public FtpletResult onConnect(FtpSession session) throws FtpException,
IOException {
System.out.println("User connected to FtpServer");
-
+
return super.onConnect(session);
}
+ /**
+ * {@inheritDoc}
+ */
@Override
public FtpletResult onDisconnect(FtpSession session) throws FtpException,
IOException {
System.out.println("User connected to FtpServer");
-
+
return super.onDisconnect(session);
}
-
-
-
}
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 b0bceb6..2734939 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
@@ -31,16 +31,21 @@
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public class Activator implements BundleActivator {
-
+ /**
+ * {@inheritDoc}
+ */
public void start(BundleContext context) throws Exception {
Dictionary<String, String> properties = new Hashtable<String, String>();
properties.put("name", "myftplet");
-
- context.registerService(Ftplet.class.getName(), new MyFtplet(), properties);
+
+ context.registerService(Ftplet.class.getName(),
+ new MyFtplet(), properties);
}
+ /**
+ * {@inheritDoc}
+ */
public void stop(BundleContext context) throws Exception {
- // do nothing
+ // do nothing
}
-
}
diff --git a/examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/impl/package-info.java b/examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/impl/package-info.java
new file mode 100644
index 0000000..c1cdd99
--- /dev/null
+++ b/examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/impl/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/**
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ */
+package org.apache.ftpserver.example.ftpletservice.impl;
diff --git a/examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/package-info.java b/examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/package-info.java
new file mode 100644
index 0000000..f2bd051
--- /dev/null
+++ b/examples/ftpserver-osgi-ftplet-service/src/main/java/org/apache/ftpserver/example/ftpletservice/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/**
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ */
+package org.apache.ftpserver.example.ftpletservice;
diff --git a/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DefaultFtplet.java b/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DefaultFtplet.java
index 8e1d8e1..14a7954 100644
--- a/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DefaultFtplet.java
+++ b/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DefaultFtplet.java
@@ -338,4 +338,4 @@
throws FtpException, IOException {
return null;
}
-}
\ No newline at end of file
+}
diff --git a/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpFile.java b/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpFile.java
index c96432b..5024ac2 100644
--- a/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpFile.java
+++ b/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpFile.java
@@ -19,7 +19,6 @@
package org.apache.ftpserver.ftplet;
-import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -40,7 +39,7 @@
String getAbsolutePath();
/**
- * Get the file name of the file
+ * Get the file name of the file.
* @return the last part of the file path (the part after the last '/').
*/
String getName();
@@ -112,26 +111,27 @@
long getLastModified();
/**
- * Set the last modified time stamp of a file
+ * Set the last modified time stamp of a file.
* @param time The last modified time, in milliseconds since the epoch. See {@link File#setLastModified(long)}.
+ * @return <code>true</code> if and only if the operation succeeded; <code>false</code> otherwise
*/
boolean setLastModified(long time);
-
+
/**
* Get file size.
* @return The size of the {@link FtpFile} in bytes
*/
long getSize();
-
+
/**
- * Returns the physical location or path of the file. It is completely up to
- * the implementation to return appropriate value based on the file system
+ * Returns the physical location or path of the file. It is completely up to
+ * the implementation to return appropriate value based on the file system
* implementation.
- *
- * @return the physical location or path of the file.
+ *
+ * @return the physical location or path of the file.
*/
Object getPhysicalFile();
-
+
/**
* Create directory.
* @return true if the operation was successful
@@ -160,22 +160,22 @@
List<? extends FtpFile> listFiles();
/**
- * Create output stream for writing.
+ * 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 {@link OutputStream} used to write to the {@link FtpFile}
- * @throws IOException
+ * @throws IOException
*/
OutputStream createOutputStream(long offset) throws IOException;
/**
- * Create input stream for reading.
- * @param offset The number of bytes of where to start reading.
+ * 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 {@link InputStream} used to read the {@link FtpFile}
- * @throws IOException
+ * @throws IOException
*/
InputStream createInputStream(long offset) throws IOException;
}
diff --git a/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpReply.java b/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpReply.java
index 721d138..921543d 100644
--- a/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpReply.java
+++ b/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpReply.java
@@ -32,240 +32,240 @@
* is User-process data stream marker, and mmmm server's equivalent marker
* (note the spaces between markers and "=").
*/
- public static final int REPLY_110_RESTART_MARKER_REPLY = 110;
+ int REPLY_110_RESTART_MARKER_REPLY = 110;
/**
* 120 Service ready in nnn minutes.
*/
- public static final int REPLY_120_SERVICE_READY_IN_NNN_MINUTES = 120;
+ int REPLY_120_SERVICE_READY_IN_NNN_MINUTES = 120;
/**
* 125 Data connection already open; transfer starting.
*/
- public static final int REPLY_125_DATA_CONNECTION_ALREADY_OPEN = 125;
+ int REPLY_125_DATA_CONNECTION_ALREADY_OPEN = 125;
/**
* 150 File status okay; about to open data connection.
*/
- public static final int REPLY_150_FILE_STATUS_OKAY = 150;
+ int REPLY_150_FILE_STATUS_OKAY = 150;
/**
* 200 Command okay.
*/
- public static final int REPLY_200_COMMAND_OKAY = 200;
+ int REPLY_200_COMMAND_OKAY = 200;
/**
* 202 Command not implemented, superfluous at this site.
*/
- public static final int REPLY_202_COMMAND_NOT_IMPLEMENTED = 202;
+ int REPLY_202_COMMAND_NOT_IMPLEMENTED = 202;
/**
* 211 System status, or system help reply.
*/
- public static final int REPLY_211_SYSTEM_STATUS_REPLY = 211;
+ int REPLY_211_SYSTEM_STATUS_REPLY = 211;
/**
* 212 Directory status.
*/
- public static final int REPLY_212_DIRECTORY_STATUS = 212;
+ int REPLY_212_DIRECTORY_STATUS = 212;
/**
* 213 File status.
*/
- public static final int REPLY_213_FILE_STATUS = 213;
+ int REPLY_213_FILE_STATUS = 213;
/**
* 214 Help message. On how to use the server or the meaning of a particular
* non-standard command. This reply is useful only to the human user.
*/
- public static final int REPLY_214_HELP_MESSAGE = 214;
+ int REPLY_214_HELP_MESSAGE = 214;
/**
* 215 NAME system type. Where NAME is an official system name from the list
* in the Assigned Numbers document.
*/
- public static final int REPLY_215_NAME_SYSTEM_TYPE = 215;
+ int REPLY_215_NAME_SYSTEM_TYPE = 215;
/**
* 220 Service ready for new user.
*/
- public static final int REPLY_220_SERVICE_READY = 220;
+ int REPLY_220_SERVICE_READY = 220;
/**
* Service closing control connection. Logged out if appropriate.
*/
- public static final int REPLY_221_CLOSING_CONTROL_CONNECTION = 221;
+ int REPLY_221_CLOSING_CONTROL_CONNECTION = 221;
/**
* 225 Data connection open; no transfer in progress.
*/
- public static final int REPLY_225_DATA_CONNECTION_OPEN_NO_TRANSFER_IN_PROGRESS = 225;
+ int REPLY_225_DATA_CONNECTION_OPEN_NO_TRANSFER_IN_PROGRESS = 225;
/**
* Closing data connection. Requested file action successful (for example,
* file transfer or file abort).
*/
- public static final int REPLY_226_CLOSING_DATA_CONNECTION = 226;
+ int REPLY_226_CLOSING_DATA_CONNECTION = 226;
/**
* 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2).
*/
- public static final int REPLY_227_ENTERING_PASSIVE_MODE = 227;
+ int REPLY_227_ENTERING_PASSIVE_MODE = 227;
/**
* 230 User logged in, proceed.
*/
- public static final int REPLY_230_USER_LOGGED_IN = 230;
+ int REPLY_230_USER_LOGGED_IN = 230;
/**
* 250 Requested file action okay, completed.
*/
- public static final int REPLY_250_REQUESTED_FILE_ACTION_OKAY = 250;
+ int REPLY_250_REQUESTED_FILE_ACTION_OKAY = 250;
/**
* 257 "PATHNAME" created.
*/
- public static final int REPLY_257_PATHNAME_CREATED = 257;
+ int REPLY_257_PATHNAME_CREATED = 257;
/**
* 331 User name okay, need password.
*/
- public static final int REPLY_331_USER_NAME_OKAY_NEED_PASSWORD = 331;
+ int REPLY_331_USER_NAME_OKAY_NEED_PASSWORD = 331;
/**
* 332 Need account for login.
*/
- public static final int REPLY_332_NEED_ACCOUNT_FOR_LOGIN = 332;
+ int REPLY_332_NEED_ACCOUNT_FOR_LOGIN = 332;
/**
* 350 Requested file action pending further information.
*/
- public static final int REPLY_350_REQUESTED_FILE_ACTION_PENDING_FURTHER_INFORMATION = 350;
+ int REPLY_350_REQUESTED_FILE_ACTION_PENDING_FURTHER_INFORMATION = 350;
/**
* 421 Service not available, closing control connection. This may be a
* reply to any command if the service knows it must shut down.
*/
- public static final int REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION = 421;
+ int REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION = 421;
/**
* 425 Can't open data connection.
*/
- public static final int REPLY_425_CANT_OPEN_DATA_CONNECTION = 425;
+ int REPLY_425_CANT_OPEN_DATA_CONNECTION = 425;
/**
* 426 Connection closed; transfer aborted.
*/
- public static final int REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED = 426;
+ int REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED = 426;
/**
* 450 Requested file action not taken. File unavailable (e.g., file busy).
*/
- public static final int REPLY_450_REQUESTED_FILE_ACTION_NOT_TAKEN = 450;
+ int REPLY_450_REQUESTED_FILE_ACTION_NOT_TAKEN = 450;
/**
* 451 Requested action aborted: local error in processing.
*/
- public static final int REPLY_451_REQUESTED_ACTION_ABORTED = 451;
+ int REPLY_451_REQUESTED_ACTION_ABORTED = 451;
/**
* 452 Requested action not taken. Insufficient storage space in system.
*/
- public static final int REPLY_452_REQUESTED_ACTION_NOT_TAKEN = 452;
+ int REPLY_452_REQUESTED_ACTION_NOT_TAKEN = 452;
/**
* 500 Syntax error, command unrecognized. This may include errors such as
* command line too long.
*/
- public static final int REPLY_500_SYNTAX_ERROR_COMMAND_UNRECOGNIZED = 500;
+ int REPLY_500_SYNTAX_ERROR_COMMAND_UNRECOGNIZED = 500;
/**
* 501 Syntax error in parameters or arguments.
*/
- public static final int REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS = 501;
+ int REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS = 501;
/**
* 502 Command not implemented.
*/
- public static final int REPLY_502_COMMAND_NOT_IMPLEMENTED = 502;
+ int REPLY_502_COMMAND_NOT_IMPLEMENTED = 502;
/**
* 503 Bad sequence of commands.
*/
- public static final int REPLY_503_BAD_SEQUENCE_OF_COMMANDS = 503;
+ int REPLY_503_BAD_SEQUENCE_OF_COMMANDS = 503;
/**
* 504 Command not implemented for that parameter.
*/
- public static final int REPLY_504_COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER = 504;
+ int REPLY_504_COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER = 504;
/**
* 530 Not logged in.
*/
- public static final int REPLY_530_NOT_LOGGED_IN = 530;
+ int REPLY_530_NOT_LOGGED_IN = 530;
/**
* 532 Need account for storing files.
*/
- public static final int REPLY_532_NEED_ACCOUNT_FOR_STORING_FILES = 532;
+ int REPLY_532_NEED_ACCOUNT_FOR_STORING_FILES = 532;
/**
* 550 Requested action not taken. File unavailable (e.g., file not found,
* no access).
*/
- public static final int REPLY_550_REQUESTED_ACTION_NOT_TAKEN = 550;
+ int REPLY_550_REQUESTED_ACTION_NOT_TAKEN = 550;
/**
* 551 Requested action aborted: page type unknown.
*/
- public static final int REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN = 551;
+ int REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN = 551;
/**
* 552 Requested file action aborted. Exceeded storage allocation (for
* current directory or dataset).
*/
- public static final int REPLY_552_REQUESTED_FILE_ACTION_ABORTED_EXCEEDED_STORAGE = 552;
+ int REPLY_552_REQUESTED_FILE_ACTION_ABORTED_EXCEEDED_STORAGE = 552;
/**
* 553 Requested action not taken. File name not allowed.
*/
- public static final int REPLY_553_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED = 553;
+ int REPLY_553_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED = 553;
/**
- * The reply code
- *
+ * The reply code.
+ *
* @return The reply code
*/
int getCode();
/**
- * The reply message, might be multiple lines
- *
+ * The reply message, might be multiple lines.
+ *
* @return The reply message
*/
String getMessage();
-
+
/**
- * Returns the timestamp (in milliseconds since the epoch time) when this
- * reply was sent.
- *
- * @return the timestamp (in milliseconds since the epoch time) when this
+ * Returns the timestamp (in milliseconds since the epoch time) when this
+ * reply was sent.
+ *
+ * @return the timestamp (in milliseconds since the epoch time) when this
* reply was sent.
*/
long getSentTime();
-
+
/**
* Must implement toString to format the reply as described in the RFC. Most
* important is the handling of multi-line replies.
- *
+ *
* @return The formated reply
*/
String toString();
-
+
/**
- * Tells whether or not this reply indicates a positive completion.
- * @return <code>true</code>, if this reply is a positive completion or
- * positive intermediate reply; <code>false</code>, otherwise.
+ * Tells whether or not this reply indicates a positive completion.
+ * @return <code>true</code>, if this reply is a positive completion or
+ * positive intermediate reply; <code>false</code>, otherwise.
*/
boolean isPositive();
}
diff --git a/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/Ftplet.java b/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/Ftplet.java
index b503b97..37b73f9 100644
--- a/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/Ftplet.java
+++ b/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/Ftplet.java
@@ -143,4 +143,4 @@
*/
FtpletResult onDisconnect(FtpSession session) throws FtpException,
IOException;
-}
\ No newline at end of file
+}