Class SimpleFTPService

java.lang.Object
org.bluezoo.gumdrop.ftp.FTPService
org.bluezoo.gumdrop.ftp.file.SimpleFTPService
All Implemented Interfaces:
Service

public class SimpleFTPService extends FTPService
FTP service for basic file-based access with optional realm authentication.

This service provides a simple FTP server that serves files from a configured root directory. When a Realm is set, users are authenticated against it; otherwise any non-empty password is accepted.

Configuration Example


 <service class="org.bluezoo.gumdrop.ftp.file.SimpleFTPService">
   <property name="root-directory">/var/ftp</property>
   <property name="read-only">false</property>
   <property name="realm" ref="#ftpRealm"/>
   <listener class="org.bluezoo.gumdrop.ftp.FTPListener" port="21"/>
 </service>
 
Author:
Chris Burdess
See Also:
  • Constructor Details

    • SimpleFTPService

      public SimpleFTPService()
  • Method Details

    • getRootDirectory

      public Path getRootDirectory()
    • setRootDirectory

      public void setRootDirectory(Path rootDirectory)
    • setRootDirectory

      public void setRootDirectory(String rootDirectory)
    • isReadOnly

      public boolean isReadOnly()
    • setReadOnly

      public void setReadOnly(boolean readOnly)
    • initService

      protected void initService()
      Description copied from class: FTPService
      Initialises service resources before listeners are started.

      The default implementation does nothing.

      Overrides:
      initService in class FTPService
    • createHandler

      protected FTPConnectionHandler createHandler(TCPListener endpoint)
      Description copied from class: FTPService
      Creates a new handler for an incoming FTP control connection on the given endpoint.

      Subclasses must implement this to provide connection-level FTP behaviour (authentication, file system access, etc.). The endpoint parameter identifies which control listener accepted the connection.

      Specified by:
      createHandler in class FTPService
      Parameters:
      endpoint - the endpoint that accepted the connection
      Returns:
      a handler for the new connection, or null for default