Skip to content

Commit

Permalink
o Fixing the remaining javadoc warnings
Browse files Browse the repository at this point in the history
o Made a SimpleDateFormat thread safe
o Minor code refactring
o Deprecated useless methods
  • Loading branch information
elecharny committed Jan 18, 2025
1 parent 06626f7 commit 3f2f833
Show file tree
Hide file tree
Showing 139 changed files with 2,081 additions and 1,433 deletions.
13 changes: 13 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@
</excludes>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<additionalJOptions>
<additionalJOption>-Xmaxerrs</additionalJOption>
<additionalJOption>65536</additionalJOption>
<additionalJOption>-Xmaxwarns</additionalJOption>
<additionalJOption>65536</additionalJOption>
</additionalJOptions>
</configuration>
</plugin>
</plugins>

<pluginManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
*
*/
public class ConnectionConfigFactory {

private int maxLogins = 10;

private boolean anonymousLoginEnabled = true;
Expand All @@ -41,6 +40,13 @@ public class ConnectionConfigFactory {

private int maxThreads = 0;

/**
* Create a ConnectionConfigFactory instance
*/
public ConnectionConfigFactory() {
// Nothing to do
}

/**
* Create a connection configuration instances based on the configuration on this factory
* @return The {@link ConnectionConfig} instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ public interface DataConnectionConfiguration {
SslConfiguration getSslConfiguration();

/**
* Tells if the connection is implicitely secured
*
* @return True if SSL is mandatory for the data channel
*/
boolean isImplicitSsl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public class DataConnectionConfigurationFactory {

/** The class logger */
private Logger log = LoggerFactory.getLogger(DataConnectionConfigurationFactory.class);

// maximum idle time in seconds
Expand All @@ -53,6 +53,12 @@ public class DataConnectionConfigurationFactory {
private boolean passiveIpCheck = false;
private boolean implicitSsl;

/**
* Public constructor for DataConnectionConfigurationFactory
*/
public DataConnectionConfigurationFactory() {
// Nothing to do
}
/**
* Create a {@link DataConnectionConfiguration} instance based on the
* configuration on this factory
Expand Down Expand Up @@ -308,6 +314,8 @@ public void setSslConfiguration(SslConfiguration ssl) {
}

/**
* Tells if the connection is implicitely scured or not
*
* @return True if ssl is mandatory for the data connection
*/
public boolean isImplicitSsl() {
Expand Down
7 changes: 4 additions & 3 deletions core/src/main/java/org/apache/ftpserver/FtpServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public interface FtpServer {

/**
* Start the server. Open a new listener thread.
* @throws FtpException
*
* @throws FtpException If the server failed to start
*/
void start() throws FtpException;

Expand All @@ -44,6 +44,7 @@ public interface FtpServer {

/**
* Get the server status.
*
* @return <code>true</code> if the server is stopped
*/
boolean isStopped();
Expand All @@ -60,8 +61,8 @@ public interface FtpServer {

/**
* Is the server suspended
*
* @return <code>true</code> if the server is suspended
*/
boolean isSuspended();

}
20 changes: 11 additions & 9 deletions core/src/main/java/org/apache/ftpserver/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,33 @@
import java.io.UncheckedIOException;
import java.util.Properties;

import org.apache.ftpserver.util.IoUtils;

/**
* Provides the version of this release of FtpServer
*
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public class Version {
/**
* A private constructor: this class should not be instanciated
*/
private Version() {
// Nothing to do
}

/**
* Get the version of this FtpServer
*
* @return The current version
*/
public static String getVersion() {
Properties props = new Properties();
InputStream in = null;

try {
in = Version.class.getClassLoader().getResourceAsStream("org/apache/ftpserver/ftpserver.properties");
try (InputStream in = Version.class.getClassLoader().
getResourceAsStream("org/apache/ftpserver/ftpserver.properties")) {
Properties props = new Properties();
props.load(in);

return props.getProperty("ftpserver.version");
} catch (IOException e) {
throw new UncheckedIOException("Failed to read version", e);
} finally {
IoUtils.close(in);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public abstract class AbstractCommand implements Command {

/** potected constructor */
protected AbstractCommand() {
// Nothing to do
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,19 @@ public class CommandFactoryFactory {
/** A flag indicating of we have non-default commands */
private boolean useDefaultCommands = true;

/**
* Create a CommandFactoryFactory instance
*/
public CommandFactoryFactory() {
// Nothing to do
}

/**
* Create an {@link CommandFactory} based on the configuration on the factory.
*
* @return The {@link CommandFactory}
*/
public CommandFactory createCommandFactory() {

Map<String, Command> mergedCommands = new HashMap<>();

if (useDefaultCommands) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public class NotSupportedCommand extends AbstractCommand {
/**
* Create a NotSupportedCommand instance
*/
public NotSupportedCommand() {
super();
}

/**
* Execute command
Expand All @@ -43,7 +49,6 @@ public class NotSupportedCommand extends AbstractCommand {
public void execute(final FtpIoSession session,
final FtpServerContext context, final FtpRequest request)
throws IOException {

// reset state variables
session.resetState();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public class ABOR extends AbstractCommand {
/** Public constructor */
public ABOR() {
super();
}

/**
* Execute command
*
* {@inheritDoc}
*/
public void execute(final FtpIoSession session,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public class ACCT extends AbstractCommand {
/** Public constructor */
public ACCT() {
super();
}

/**
* Execute command.
*
* {@inheritDoc}
*/
public void execute(final FtpIoSession session,
final FtpServerContext context, final FtpRequest request)
throws IOException {

// reset state variables
session.resetState();

Expand Down
Loading

0 comments on commit 3f2f833

Please sign in to comment.