public class FTPServerFacade extends Object
Modifier and Type | Class and Description |
---|---|
protected class |
FTPServerFacade.LocalControlChannel
This inner class represents a local control channel.
|
Modifier and Type | Field and Description |
---|---|
static int |
ANY_PORT
local server socket parameter; used in setPassive()
|
protected DataChannelFactory |
dataChannelFactory |
static int |
DEFAULT_QUEUE
local server socket parameter; used in setPassive()
|
protected FTPServerFacade.LocalControlChannel |
localControlChannel |
protected FTPControlChannel |
remoteControlChannel |
protected HostPort |
remoteServerAddress |
protected ServerSocket |
serverSocket |
protected Session |
session |
Constructor and Description |
---|
FTPServerFacade(FTPControlChannel remoteControlChannel) |
Modifier and Type | Method and Description |
---|---|
void |
abort()
close data channels, but not control, nor the server
|
void |
authorize()
No need for parameters; locally you are always authorized.
|
static void |
cannotPropagateError(Throwable e)
Data channels are operated in multithreaded manner and they pass
information (including exceptions) to the user using the local
control channel.
|
void |
close() |
protected TransferContext |
createTransferContext() |
protected void |
exceptionToControlChannel(Throwable e,
String msg)
Convert the exception to a negative 451 reply, and pipe
it to the control channel.
|
static void |
exceptionToControlChannel(Throwable e,
String msg,
BasicServerControlChannel control)
Convert the exception to a negative 451 reply, and pipe
it to the provided control channel.
|
BasicClientControlChannel |
getControlChannel()
Use this method to get the client end of the local
control channel.
|
Session |
getSession() |
void |
retrieve(DataSource source)
Asynchronous; return before completion.
|
void |
setActive(HostPort hp)
Asynchronous; return before completion.
|
void |
setOptions(Options opts)
Do nothing; this class does not support any options
|
HostPort |
setPassive()
Behave like setPassive(ANY_PORT, DEFAULT_QUEUE)
|
HostPort |
setPassive(int port,
int queue)
Start the local server
|
void |
setProtectionBufferSize(int size) |
void |
setTransferMode(int mode) |
void |
setTransferType(int type) |
protected void |
stopTaskThread() |
void |
store(DataSink sink)
Asynchronous; return before completion.
|
protected void |
transferAbort() |
protected void |
unblockServer() |
public static final int ANY_PORT
public static final int DEFAULT_QUEUE
protected Session session
protected FTPServerFacade.LocalControlChannel localControlChannel
protected DataChannelFactory dataChannelFactory
protected ServerSocket serverSocket
protected FTPControlChannel remoteControlChannel
protected HostPort remoteServerAddress
public FTPServerFacade(FTPControlChannel remoteControlChannel)
public static void cannotPropagateError(Throwable e)
public BasicClientControlChannel getControlChannel()
public Session getSession()
public void authorize()
public void setTransferType(int type)
public void setTransferMode(int mode)
public void setProtectionBufferSize(int size)
public void setOptions(Options opts)
public HostPort setPassive() throws IOException
IOException
public HostPort setPassive(int port, int queue) throws IOException
port
- required server port; can be set to ANY_PORTqueue
- max size of queue of awaiting new connection
requestsIOException
public void setActive(HostPort hp) throws UnknownHostException, ClientException, IOException
protected void exceptionToControlChannel(Throwable e, String msg)
public static void exceptionToControlChannel(Throwable e, String msg, BasicServerControlChannel control)
public void store(DataSink sink)
public void retrieve(DataSource source)
public void abort() throws IOException
IOException
protected void transferAbort()
protected void unblockServer()
public void close() throws IOException
IOException
protected void stopTaskThread()
protected TransferContext createTransferContext()
Copyright © 2016. All rights reserved.