public class FtpServerFactory extends Object
Constructor and Description |
---|
FtpServerFactory()
Creates a server with the default configuration
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(String name,
Listener listener)
Add a
Listener to this factory |
FtpServer |
createServer()
Create a
DefaultFtpServer instance based
on the provided configuration |
CommandFactory |
getCommandFactory()
Retrieve the command factory used by servers created by this factory
|
ConnectionConfig |
getConnectionConfig()
Retrieve the connection configuration this server
|
FileSystemFactory |
getFileSystem()
Retrieve the file system used by servers created by this factory
|
Map<String,Ftplet> |
getFtplets()
Get all
Ftplet s registered by servers created by this factory |
Listener |
getListener(String name)
Get a specific
Listener identified by its name |
Map<String,Listener> |
getListeners()
Get all listeners available on servers created by this factory
|
MessageResource |
getMessageResource()
Retrieve the message resource used by servers created by this factory
|
UserManager |
getUserManager()
Retrieve the user manager used by servers created by this factory
|
void |
setCommandFactory(CommandFactory commandFactory)
Set the command factory to be used by servers created by this factory
|
void |
setConnectionConfig(ConnectionConfig connectionConfig)
Set the message resource to be used with this server
|
void |
setFileSystem(FileSystemFactory fileSystem)
Set the file system to be used by servers created by this factory
|
void |
setFtplets(Map<String,Ftplet> ftplets)
Set the
Ftplet s to be active by servers created by this factory. |
void |
setListeners(Map<String,Listener> listeners)
Set the listeners for servers created by this factory, replaces existing listeners
|
void |
setMessageResource(MessageResource messageResource)
Set the message resource to be used with by servers created by this factory
|
void |
setUserManager(UserManager userManager)
Set the user manager to be used by servers created by this factory
|
public FtpServerFactory()
Exception
public FtpServer createServer()
DefaultFtpServer
instance based
on the provided configurationDefaultFtpServer
instancepublic Map<String,Listener> getListeners()
public Listener getListener(String name)
Listener
identified by its namename
- The name of the listenerListener
matching the provided namepublic void addListener(String name, Listener listener)
Listener
to this factoryname
- The name of the listenerlistener
- The Listener
public void setListeners(Map<String,Listener> listeners)
listeners
- The listeners to use for this server with the name as the key
and the listener as the valueIllegalStateException
- If a custom server context has been setpublic Map<String,Ftplet> getFtplets()
Ftplet
s registered by servers created by this factoryFtplet
spublic void setFtplets(Map<String,Ftplet> ftplets)
ftplets
- Ftplets as a map with the name as the key and the Ftplet as
the value. The Ftplet container will iterate over the map in the
order provided by the Map. If invocation order of Ftplets is of importance,
make sure to provide a ordered Map, for example LinkedHashMap
.IllegalStateException
- If a custom server context has been setpublic UserManager getUserManager()
public void setUserManager(UserManager userManager)
userManager
- The UserManager
IllegalStateException
- If a custom server context has been setpublic FileSystemFactory getFileSystem()
FileSystemFactory
public void setFileSystem(FileSystemFactory fileSystem)
fileSystem
- The FileSystemFactory
IllegalStateException
- If a custom server context has been setpublic CommandFactory getCommandFactory()
CommandFactory
public void setCommandFactory(CommandFactory commandFactory)
commandFactory
- The CommandFactory
IllegalStateException
- If a custom server context has been setpublic MessageResource getMessageResource()
MessageResource
public void setMessageResource(MessageResource messageResource)
messageResource
- The MessageResource
IllegalStateException
- If a custom server context has been setpublic ConnectionConfig getConnectionConfig()
MessageResource
public void setConnectionConfig(ConnectionConfig connectionConfig)
connectionConfig
- The ConnectionConfig
to be used
by servers created by this factorymessageResource
- The MessageResource
IllegalStateException
- If a custom server context has been setCopyright © 2003–2016 The Apache Software Foundation. All rights reserved.