Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
6b555e6
Branching 1.0.x
Feb 1, 2009
e3f85f0
Using the JVM default keystore and truststore algorithm, rather than …
Feb 4, 2009
c9e2a6e
Fixing issue where NioListener.getPort() is not updated on resume whe…
Feb 14, 2009
91347ac
Increasing version for new development towards 1.0.1
Feb 21, 2009
79128f2
Making sure our SSL tests work on IBM JDK
Feb 22, 2009
777287e
Making our test behave better in our CI builds where concurrent build…
Feb 22, 2009
b2e5386
Update README.txt
Feb 23, 2009
a76405b
Set socket timeout for FTP client
Feb 23, 2009
e9b167e
Fix for File.equals problem on OS X, we now use the canonical path in…
Mar 8, 2009
0b63f95
Closing streams on up-/downloads so that a failure to do so will keep…
Mar 8, 2009
ecab1c6
Added missing columns in the select-user example
Mar 13, 2009
3456f0a
Adding timeout on data connection sockets (as well as some extra logg…
Apr 24, 2009
b96cd4e
Fix bug where the an open data connection will not be closed on the f…
May 13, 2009
9b03661
Updating README.txt with 1.0.1 release
May 13, 2009
ccf44ac
Increasing version for new development in 1.0.x
May 13, 2009
6ab7cd3
Increasing version for new development in 1.0.x
May 13, 2009
35a67b0
Removing Rev and Date tags
May 13, 2009
b1247e0
FTPSERVER-303 Underlying plain socket in SSL passive data connections…
May 25, 2009
fbb605e
FTPSERVER-306 EOL sequence is lost if the file wasn't correctly trans…
May 27, 2009
f2c7439
Fixed incorrect comparison of the user level idle time and the listen…
May 30, 2009
950d8da
Return an error reply rather than close the session if we get a decod…
May 30, 2009
a6e2461
Don't mess with the casing when logging the received command (FTPSERV…
May 30, 2009
51c0bc6
Comment out the db user manager to make the configuration valid out o…
May 30, 2009
90f93f2
Added check for passive ports allocation to check if the port is not …
Jun 7, 2009
3165e36
Adding some comments to the new code in FTPSERVER-302
Jun 7, 2009
ea65c94
Configuring the correct deploy path for releases
Jun 8, 2009
ff7ecd0
Upgrading to MINA 2.0.0-M6
Jun 9, 2009
efc363c
Using the site URL in author tags (FTPSERVER-314)
Jun 10, 2009
1d66b05
Using the site URL in author tags (FTPSERVER-314)
Jun 10, 2009
d179835
Updating README
Jun 12, 2009
cd0bc95
Increasing version for new development in 1.0.x
Jun 12, 2009
922f8ce
Fixed exception where we fail to forward the cause to the super const…
Sep 21, 2009
b8d91bf
Setting the WAR plugin version. Creating unique project names for Ecl…
Sep 22, 2009
d346c0f
Fixing issue where we returned timestamps in the local time zone rath…
Sep 24, 2009
5d39599
Fixing typo (FTPSERVER-332)
Sep 24, 2009
130fc8b
Fixing issue where we incorrectly displayed hidden files in file list…
Sep 24, 2009
dcb09c7
Updating readme
Sep 25, 2009
a5a18e0
Increasing version for new development in 1.0.x branch
Sep 25, 2009
d3db22c
Reverting previous change so that LIST and STAT now continues to retu…
Sep 28, 2009
e8608af
Fixing NPE thrown when restarting a stopped FtpServer and improving J…
Nov 19, 2009
42edae6
Add check for non-zero port for the PORT command (FTPSERVER-341)
Nov 30, 2009
273dfa3
Fix for Jira Issue FTPSERVER-345
Jan 28, 2010
b6b92f7
Fixed the test case to handle possible quotes around file name in the…
Jan 28, 2010
e2219cb
Fixing bug where we did not correctly handle multiline replies with l…
Feb 18, 2010
3251c11
Remove check for File.fileSeparatorChar from MKD command. Will fail i…
Feb 27, 2010
4e4adf8
Adding factory for creating users, especially useful in OSGi environm…
Mar 7, 2010
fd9fe35
Upgrading to MINA 2.0.0-RC1 (FTPSERVER-353)
Mar 7, 2010
2c11902
Updated readme
Mar 7, 2010
ec2e19b
Increasing version for new development in branch
Mar 7, 2010
3d3b793
Improving fix for padding lines in replies starting with digits
Mar 7, 2010
25dc35b
Fixing typo in POM (FTPSERVER-356)
Mar 11, 2010
09633b9
Fix for FTPSERVER-360
Mar 29, 2010
7a5ee91
Implemented FTPSERVER-357
Mar 29, 2010
276d2a0
Fixing invalid uses of POM properties (FTPSERVER-368)
Apr 30, 2010
da7c7e7
FTPSERVER-369 maxLogin is reached immediately. REIN command is not de…
May 10, 2010
18d804d
Updating the ManagingUsers example showing how to use UserFactory in …
May 24, 2010
5cc94ea
Fix typo in POM (FTPSERVER-373)
Jun 9, 2010
1361845
Correctly closing DB connection used for first verifying the connecti…
Jul 15, 2010
22c3d74
Adding support for listing files using the STAT command (FTPSERVER-383)
Sep 5, 2010
3ead013
Fixing incorrect Javadoc for ConnectionConfigFactory.get/setMaxAnonym…
Sep 5, 2010
60b156e
Adding tar.bz2 distribution (FTPSERVER-354)
Sep 5, 2010
de8ce0c
Fixing issue where the suspend state was not correctly reset when res…
Sep 14, 2010
3e4439e
Adding check so that NioListener.start() can not be called on a start…
Sep 15, 2010
56afac4
Fixing bug where a disabled user was allowed to login (FTPSERVER-387)
Sep 20, 2010
9577848
Merging patch for using a shared, configurable thread pool executor (…
Sep 22, 2010
d79ca95
Updating readme
Sep 26, 2010
21213a1
Increasing version for new development in 1.0.x branch
Sep 26, 2010
2821a1b
Fixing out-dated license header
Sep 27, 2010
045f39c
Fixing broken OSGi package configuration
Sep 27, 2010
a4e3974
OPTS MLST should support any character case of field names (FTPSERVER…
Jan 21, 2011
fc3d942
Upgrading MINA to 2.0.2
Feb 21, 2011
0b9772c
Removing cruft in SQL script (FTPSERVER-398)
Feb 23, 2011
28818a1
StringBuffer => StringBuilder for internal use (FTPSERVER-406)
Mar 27, 2011
f130107
Fixing bug where FtpServer returned an error if an unknown fact was u…
May 11, 2011
ac413ed
Returning 211 rather than 200 from STAT file listing (FTPSERVER-413)
May 28, 2011
2f5e76f
Returning the correct reply codes for file and directory listings (FT…
May 30, 2011
f69f49e
Removing useless, incorrect test
May 30, 2011
bb1a583
Ensuring that STAT file listings will not return a file listing recor…
May 31, 2011
c9d023f
Removing oro dependency (FTPSERVER-416)
Jun 1, 2011
3378cf6
Doing an explicit null check in PassivePorts (FTPSERVER-415)
Jun 1, 2011
5db7c5f
New implementation of passive ports, uses random assignments of ports…
Jun 18, 2011
f4a5ed7
Upgrading to MINA 2.0.4 (FTPSERVER-421)
Jun 18, 2011
600a76b
Adding hashCode() to NativeFtpFile (FTPSERVER-375)
Jun 19, 2011
4998328
Simplified hashCode() of NativeFtpFile (FTPSERVER-375)
Jun 19, 2011
2acd3b0
Replacing expired example certificate (FTPSERVER-404)
Jun 19, 2011
c5b6554
No need to check for null when using instanceof
sebbASF Jun 20, 2011
d530aa5
Fix broken test, where assert was invoked in a separate thread, and c…
Jun 22, 2011
0180247
FTPSERVER-375 - use canonicalPath rather than File to implement equal…
sebbASF Jun 22, 2011
033a484
Missing @Overrides
sebbASF Jun 22, 2011
7ec38d0
Working around a bug in the IBM JVM which might cause a NPE in test t…
Jun 23, 2011
1c7bbb6
Updating README for 1.0.6
Jun 25, 2011
136f7bd
Updating README for 1.0.6
Jun 25, 2011
7a3dadb
Increasing version for new development in 1.0.x branch
Jun 25, 2011
e637ec6
Changing deployment to use repository.apache.org
Jun 25, 2011
050c395
Upgrading to latest Apache parent POM and the latest bundle Maven plu…
Jun 27, 2011
68d84be
Reserving passive port might remove an unused port from freeList, cau…
Aug 29, 2011
1745ea2
Upgrading slf4j
Nov 2, 2011
8c10e77
Fixing CRLF line endings
May 1, 2012
d3216d7
Remove duplicate code
May 1, 2012
74f35ad
Correctly set the data connection as protected when using AUTH SSL
May 1, 2012
78b296b
Fix for broken OSGi packages (FTPSERVER-425)
Sep 15, 2012
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
44 changes: 16 additions & 28 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
<parent>
<artifactId>ftpserver-parent</artifactId>
<groupId>org.apache.ftpserver</groupId>
<version>1.0.0-RC3-SNAPSHOT</version>
<version>1.0.7-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.ftpserver</groupId>
<artifactId>ftpserver-core</artifactId>
<name>Apache FtpServer Core</name>
<version>1.0.0-RC3-SNAPSHOT</version>
<version>1.0.7-SNAPSHOT</version>
<packaging>bundle</packaging>
<scm>
<connection>
Expand Down Expand Up @@ -58,32 +58,25 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>1.4.1</version>
<version>2.3.4</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName> ${artifactId}</Bundle-SymbolicName>
<Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
<Export-Package> org.apache.ftpserver;version=${pom.version},
org.apache.ftpserver.command;version=${pom.version},
org.apache.ftpserver.config.spring;version=${pom.version},
org.apache.ftpserver.filesystem.nativefs;version=${pom.version},
org.apache.ftpserver.ftpletcontainer;version=${pom.version},
org.apache.ftpserver.listener;version=${pom.version},
org.apache.ftpserver.main;version=${pom.version},
org.apache.ftpserver.message;version=${pom.version},
org.apache.ftpserver.ssl;version=${pom.version},
org.apache.ftpserver.usermanager;version=${pom.version}
<Export-Package> org.apache.ftpserver;version=${project.version},
org.apache.ftpserver.command;version=${project.version},
org.apache.ftpserver.config.spring;version=${project.version},
org.apache.ftpserver.filesystem.nativefs;version=${project.version},
org.apache.ftpserver.ftpletcontainer;version=${project.version},
org.apache.ftpserver.ipfilter;version=${project.version},
org.apache.ftpserver.listener;version=${project.version},
org.apache.ftpserver.main;version=${project.version},
org.apache.ftpserver.message;version=${project.version},
org.apache.ftpserver.ssl;version=${project.version},
org.apache.ftpserver.usermanager;version=${project.version}
</Export-Package>
<Private-Package> org.apache.ftpserver.command.impl,
org.apache.ftpserver.command.impl.listing,
org.apache.ftpserver.filesystem.nativefs.impl,
org.apache.ftpserver.ftpletcontainer.impl,
org.apache.ftpserver.impl, org.apache.ftpserver.listener.nio,
org.apache.ftpserver.message.impl, org.apache.ftpserver.ssl.impl,
org.apache.ftpserver.usermanager.impl,
org.apache.ftpserver.util</Private-Package>
<Import-Package>
<Import-Package>
org.springframework.beans.factory.config;resolution:=optional;version="2.5",
org.springframework.beans.factory.support;resolution:=optional;version="2.5",
org.springframework.beans.factory.xml;resolution:=optional;version="2.5",
Expand All @@ -108,7 +101,7 @@
</build>
<dependencies>
<dependency>
<groupId>${groupId}</groupId>
<groupId>${project.groupId}</groupId>
<artifactId>ftplet-api</artifactId>
</dependency>
<dependency>
Expand Down Expand Up @@ -159,11 +152,6 @@
<artifactId>commons-codec</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>oro</groupId>
<artifactId>oro</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package org.apache.ftpserver.examples;

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -19,6 +17,8 @@
* under the License.
*/

package org.apache.ftpserver.examples;

import java.io.File;

import org.apache.ftpserver.FtpServer;
Expand All @@ -27,6 +27,9 @@
import org.apache.ftpserver.ssl.SslConfigurationFactory;
import org.apache.ftpserver.usermanager.PropertiesUserManagerFactory;

/**
* @author <a href="http://mina.apache.org">Apache MINA Project</a>*
*/
public class EmbeddingFtpServer {

public static void main(String[] args) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@
import org.apache.ftpserver.ftplet.UserManager;
import org.apache.ftpserver.usermanager.PropertiesUserManagerFactory;
import org.apache.ftpserver.usermanager.SaltedPasswordEncryptor;
import org.apache.ftpserver.usermanager.UserFactory;
import org.apache.ftpserver.usermanager.impl.BaseUser;

/**
* @author <a href="http://mina.apache.org">Apache MINA Project</a>*
*/
public class ManagingUsers {

public static void main(String[] args) throws Exception {
Expand All @@ -35,11 +39,11 @@ public static void main(String[] args) throws Exception {
userManagerFactory.setPasswordEncryptor(new SaltedPasswordEncryptor());
UserManager um = userManagerFactory.createUserManager();

BaseUser user = new BaseUser();
user.setName("myNewUser");
user.setPassword("secret");
user.setHomeDirectory("ftproot");

UserFactory userFact = new UserFactory();
userFact.setName("myNewUser");
userFact.setPassword("secret");
userFact.setHomeDirectory("ftproot");
User user = userFact.createUser();
um.save(user);
}
}
13 changes: 10 additions & 3 deletions core/src/main/java/org/apache/ftpserver/ConnectionConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
* Interface for providing the configuration for the control socket connections.
*
*
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev$, $Date$
*
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public interface ConnectionConfig {

Expand Down Expand Up @@ -60,4 +58,13 @@ public interface ConnectionConfig {
* @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.
*/
int getMaxThreads();
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
/**
* Factory for creating connection configurations
*
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev$, $Date$
*
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public class ConnectionConfigFactory {

Expand All @@ -40,16 +38,18 @@ public class ConnectionConfigFactory {

private int loginFailureDelay = 500;

private int maxThreads = 0;

/**
* Create a connection configuration instances based on the configuration on this factory
* @return The {@link ConnectionConfig} instance
*/
public ConnectionConfig createConnectionConfig() {
return new DefaultConnectionConfig(anonymousLoginEnabled,
loginFailureDelay, maxLogins, maxAnonymousLogins,
maxLoginFailures);
maxLoginFailures, maxThreads);
}

/**
* The delay in number of milliseconds between login failures. Important to
* make brute force attacks harder.
Expand All @@ -61,8 +61,8 @@ public int getLoginFailureDelay() {
}

/**
* The maximum number of time an anonymous user can fail to login before getting disconnected
* @return The maximum number of failer login attempts
* The maximum number of anonymous logins the server would allow at any given time
* @return The maximum number of anonymous logins
*/
public int getMaxAnonymousLogins() {
return maxAnonymousLogins;
Expand Down Expand Up @@ -101,6 +101,29 @@ public void setMaxLogins(final int maxLogins) {
this.maxLogins = maxLogins;
}

/**
* 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.
*/
public int getMaxThreads() {
return maxThreads;
}

/**
* Sets the maximum number of threads the server is allowed to create for
* processing client requests.
*
* @param maxThreads
* the maximum number of threads the server is allowed to create
* for processing client requests.
*/
public void setMaxThreads(int maxThreads) {
this.maxThreads = maxThreads;
}

/**
* Set if anonymous logins are allowed at the server
* @param anonymousLoginEnabled true if anonymous logins should be enabled
Expand All @@ -110,8 +133,8 @@ public void setAnonymousLoginEnabled(final boolean anonymousLoginEnabled) {
}

/**
* Sets the maximum number of time an anonymous user can fail to login before getting disconnected
* @param maxAnonymousLogins The maximum number of failer login attempts
* Sets the maximum number of anonymous logins the server would allow at any given time
* @param maxAnonymousLogins The maximum number of anonymous logins
*/
public void setMaxAnonymousLogins(final int maxAnonymousLogins) {
this.maxAnonymousLogins = maxAnonymousLogins;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
/**
* Data connection configuration interface.
*
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev$, $Date$
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public interface DataConnectionConfiguration {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,23 @@

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Collections;

import org.apache.ftpserver.impl.DefaultDataConnectionConfiguration;
import org.apache.ftpserver.impl.PassivePorts;
import org.apache.ftpserver.ssl.SslConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Data connection factory
*
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev: 701863 $, $Date: 2008-10-05 21:25:50 +0200 (Sun, 05 Oct 2008) $
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public class DataConnectionConfigurationFactory {

private Logger log = LoggerFactory.getLogger(DataConnectionConfigurationFactory.class);

// maximum idle time in seconds
private int idleTime = 300;
private SslConfiguration ssl;
Expand All @@ -45,7 +49,7 @@ public class DataConnectionConfigurationFactory {

private String passiveAddress;
private String passiveExternalAddress;
private PassivePorts passivePorts = new PassivePorts(new int[] { 0 });
private PassivePorts passivePorts = new PassivePorts(Collections.<Integer>emptySet(), true);
private boolean implicitSsl;

/**
Expand Down Expand Up @@ -212,6 +216,7 @@ public synchronized int requestPassivePort() {
// no available free port - wait for the release notification
if (dataPort == -1) {
try {
log.info("Out of passive ports, waiting for one to be released. Might be stuck");
wait();
} catch (InterruptedException ex) {
}
Expand Down Expand Up @@ -245,7 +250,7 @@ public String getPassivePorts() {
* @param passivePorts The passive ports string
*/
public void setPassivePorts(String passivePorts) {
this.passivePorts = new PassivePorts(passivePorts);
this.passivePorts = new PassivePorts(passivePorts, true);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
/**
* Thrown if a data connection can not be established
*
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev$, $Date$
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public class DataConnectionException extends FtpException {
private static final long serialVersionUID = -1328383839917648987L;
Expand Down Expand Up @@ -67,6 +66,6 @@ public DataConnectionException(final Throwable th) {
* the original cause
*/
public DataConnectionException(final String msg, final Throwable th) {
super(msg);
super(msg, th);
}
}
3 changes: 1 addition & 2 deletions core/src/main/java/org/apache/ftpserver/FtpServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
* thread. <code>Server</code> implementation is used to create the server
* socket and handle client connection.
*
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev: 701885 $, $Date: 2008-10-05 22:51:37 +0200 (Sun, 05 Oct 2008) $
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public interface FtpServer {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
* Exception used during startup to indicate that the configuration is not
* correct.
*
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev$, $Date$
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public class FtpServerConfigurationException extends RuntimeException {

Expand Down
5 changes: 2 additions & 3 deletions core/src/main/java/org/apache/ftpserver/FtpServerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,16 @@
import org.apache.ftpserver.ftplet.Ftplet;
import org.apache.ftpserver.ftplet.UserManager;
import org.apache.ftpserver.ftpletcontainer.impl.DefaultFtpletContainer;
import org.apache.ftpserver.impl.DefaultFtpServerContext;
import org.apache.ftpserver.impl.DefaultFtpServer;
import org.apache.ftpserver.impl.DefaultFtpServerContext;
import org.apache.ftpserver.listener.Listener;
import org.apache.ftpserver.message.MessageResource;

/**
* This is the starting point of all the servers. Creates server instances based on
* the provided configuration.
*
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev: 701885 $, $Date: 2008-10-05 22:51:37 +0200 (Sun, 05 Oct 2008) $
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public class FtpServerFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
/**
* Common base class recommended for {@link Command} implementations
*
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev$, $Date$
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public abstract class AbstractCommand implements Command {

Expand Down
3 changes: 1 addition & 2 deletions core/src/main/java/org/apache/ftpserver/command/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
/**
* This interface encapsulates all the FTP commands.
*
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev$, $Date$
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public interface Command {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
/**
* Command factory interface.
*
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev$, $Date$
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
public interface CommandFactory {

Expand Down
Loading