Package org.bluezoo.gumdrop.ftp.file
Class SimpleFTPService
java.lang.Object
org.bluezoo.gumdrop.ftp.FTPService
org.bluezoo.gumdrop.ftp.file.SimpleFTPService
- All Implemented Interfaces:
Service
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected FTPConnectionHandlercreateHandler(TCPListener endpoint) Creates a new handler for an incoming FTP control connection on the given endpoint.protected voidInitialises service resources before listeners are started.booleanvoidsetReadOnly(boolean readOnly) voidsetRootDirectory(String rootDirectory) voidsetRootDirectory(Path rootDirectory) Methods inherited from class org.bluezoo.gumdrop.ftp.FTPService
addDynamicListener, addListener, destroyService, getListeners, getRealm, isRequireTLSForData, removeDynamicListener, setListeners, setRealm, setRequireTLSForData, start, stop
-
Constructor Details
-
SimpleFTPService
public SimpleFTPService()
-
-
Method Details
-
getRootDirectory
-
setRootDirectory
-
setRootDirectory
-
isReadOnly
public boolean isReadOnly() -
setReadOnly
public void setReadOnly(boolean readOnly) -
initService
protected void initService()Description copied from class:FTPServiceInitialises service resources before listeners are started.The default implementation does nothing.
- Overrides:
initServicein classFTPService
-
createHandler
Description copied from class:FTPServiceCreates 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
endpointparameter identifies which control listener accepted the connection.- Specified by:
createHandlerin classFTPService- Parameters:
endpoint- the endpoint that accepted the connection- Returns:
- a handler for the new connection, or null for default
-