public class FTPServer extends NetworkFileServer implements Runnable, ConfigurationListener
Create an FTP server on the specified port. The default server port is 21.
Modifier and Type | Field and Description |
---|---|
protected static ThreadGroup |
FTPThreadGroup |
protected static int |
LISTEN_BACKLOG |
protected static int |
SERVER_PORT |
SHUTDOWN_TIMEOUT
StsAccepted, StsIgnored, StsNewSessionsOnly, StsRestartRequired
Constructor and Description |
---|
FTPServer(ServerConfiguration config)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
addSession(FTPSrvSession sess)
Add a new session to the server
|
protected FTPDataSession |
allocateDataSession(FTPSrvSession sess,
InetAddress remAddr,
int remPort)
Allocate a local port for a data session
|
protected FTPDataSession |
allocatePassiveDataSession(FTPSrvSession sess,
InetAddress localAddr)
Allocate a local port for a passive mode data session
|
boolean |
allowAnonymous()
Check if anonymous logins are allowed
|
int |
configurationChanged(int id,
ServerConfiguration config,
Object newVal)
Validate configuration changes that are relevant to the FTP server
|
String |
getAnonymousAccount()
Return the anonymous login user name
|
InetAddress |
getBindAddress()
Return the address that the FTP server should bind to
|
protected FTPConfigSection |
getFTPConfiguration()
Return the FTP server configuration
|
protected int |
getNextSessionId()
Return the next available session id
|
int |
getPort()
Return the FTP server port
|
FTPPath |
getRootPath()
Return the root path for new sessions
|
String |
getServerName()
Return the server name
|
SharedDeviceList |
getShareList()
Get the shared device list
|
FTPSiteInterface |
getSiteInterface()
Return the site interface
|
protected ServerSocket |
getSocket()
Return the server socket
|
UTF8Normalizer |
getUTF8Normalizer()
Return the UTF-8 normalizer
|
boolean |
hasBindAddress()
Check if the FTP server is to be bound to a specific network adapter
|
boolean |
hasRootPath()
Check if the root path is set
|
boolean |
hasSiteInterface()
Check if the site interface is valid
|
boolean |
hasUTF8Normalizer()
Check if the UTF-8 string normalizer is valid
|
protected void |
releaseDataSession(FTPDataSession dataSess)
Release a data session
|
protected void |
removeSession(FTPSrvSession sess)
emove a session from the server
|
void |
run()
Start the SMB server.
|
protected void |
sessionLoggedOn(SrvSession sess)
Notify the server that a user has logged on.
|
void |
setSiteInterface(FTPSiteInterface siteInterface)
Set the site specific commands interface
|
void |
shutdownServer(boolean immediate)
Shutdown the FTP server
|
void |
startServer()
Start the FTP server in a seperate thread
|
addFileListener, fireCloseFileEvent, fireOpenFileEvent, getFilesystemConfiguration, removeFileListener
addServerListener, addSessionListener, clearException, findShare, fireServerEvent, fireSessionClosedEvent, fireSessionLoggedOnEvent, fireSessionOpenEvent, getAccessControlManager, getConfiguration, getException, getFullShareList, getGlobalConfiguration, getProtocolName, getSecurityConfiguration, getServerAddresses, getShareList, getShareMapper, hasAccessControlManager, hasDebug, hasDebugFlag, hasException, hasShutdown, isActive, isEnabled, isVersion, removeServerListener, removeSessionListener, setActive, setDebug, setDebugFlags, setEnabled, setException, setServerAddresses, setShutdown, setVersion
protected static final int LISTEN_BACKLOG
protected static final int SERVER_PORT
protected static final ThreadGroup FTPThreadGroup
public FTPServer(ServerConfiguration config)
config
- ServerConfigurationprotected final void addSession(FTPSrvSession sess)
sess
- FTPSrvSessionprotected final void removeSession(FTPSrvSession sess)
sess
- FTPSrvSessionprotected final FTPDataSession allocateDataSession(FTPSrvSession sess, InetAddress remAddr, int remPort) throws IOException
sess
- FTPSrvSessionremAddr
- InetAddressremPort
- intIOException
protected final FTPDataSession allocatePassiveDataSession(FTPSrvSession sess, InetAddress localAddr) throws IOException
sess
- FTPSrvSessionlocalAddr
- InetAddressIOException
protected final void releaseDataSession(FTPDataSession dataSess)
dataSess
- FTPDataSessionpublic final String getServerName()
public final SharedDeviceList getShareList()
public final boolean hasBindAddress()
public final InetAddress getBindAddress()
public final boolean hasRootPath()
public final boolean allowAnonymous()
public final String getAnonymousAccount()
protected final int getNextSessionId()
protected final FTPConfigSection getFTPConfiguration()
public final int getPort()
protected final ServerSocket getSocket()
public final FTPPath getRootPath()
protected final void sessionLoggedOn(SrvSession sess)
sess
- SrvSessionpublic void shutdownServer(boolean immediate)
shutdownServer
in class NetworkServer
immediate
- booleanpublic void startServer()
startServer
in class NetworkServer
public int configurationChanged(int id, ServerConfiguration config, Object newVal) throws InvalidConfigurationException
configurationChanged
in interface ConfigurationListener
id
- intconfig
- ServerConfigurationnewVal
- ObjectInvalidConfigurationException
public final boolean hasSiteInterface()
public final FTPSiteInterface getSiteInterface()
public final void setSiteInterface(FTPSiteInterface siteInterface)
siteInterface
- FTPSiteInterfacepublic final boolean hasUTF8Normalizer()
public final UTF8Normalizer getUTF8Normalizer()
Copyright © 2005–2017 Alfresco Software. All rights reserved.