|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--rheise.jftpd.ServerDTP
This is the server data transfer process. It is responsible for transferring files to and from the client. A separate data socket is created to transfer the data.
Field Summary | |
private java.lang.String |
dataHost
The host of the data socket. |
private int |
dataPort
The port of the data socket. |
private Representation |
representation
The representation being used for transmission. |
private ServerPI |
serverPI
The ServerPI that uses this DTP. |
private TransmissionMode |
transmissionMode
The transmission mode to be used. |
Constructor Summary | |
ServerDTP(ServerPI serverPI)
Creates a server data transfer process for the specified ServerPI. |
Method Summary | |
Representation |
getRepresentation()
|
private void |
listFile(java.io.File file,
java.io.PrintWriter writer)
Lists a single file in long format (including file sizes and modification dates etc.). |
private static java.lang.String |
pad(int length)
|
int |
receiveFile(java.lang.String path)
Opens the data connection, reads the data according to the current transmission mode, representation type and structure, and writes it into the local file "path". |
int |
sendFile(java.lang.String path)
Opens the data connection reads the specified local file and writes it to the data socket using the current transmission mode, representation type and structure. |
int |
sendList(java.lang.String path)
Sends a list of files in the specified directory to the User DTP. |
int |
sendNameList(java.lang.String path)
Sends a list of file names to the User DTP. |
void |
setDataPort(java.lang.String host,
int port)
Sets the data port for an active transmission. |
void |
setDataStructure(char stru)
Sets the structure. |
void |
setRepresentation(Representation representation)
Sets the representation type used for transmission. |
void |
setTransmissionMode(TransmissionMode transmissionMode)
Sets the transmission mode. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private ServerPI serverPI
private java.lang.String dataHost
private int dataPort
private TransmissionMode transmissionMode
private Representation representation
Constructor Detail |
public ServerDTP(ServerPI serverPI)
Method Detail |
public void setTransmissionMode(TransmissionMode transmissionMode)
public void setDataStructure(char stru)
public Representation getRepresentation()
public void setRepresentation(Representation representation)
public void setDataPort(java.lang.String host, int port)
host
- the host name to connect to.port
- the port number to connect to.public int receiveFile(java.lang.String path) throws CommandException
public int sendFile(java.lang.String path) throws CommandException
public int sendNameList(java.lang.String path) throws CommandException
path
- the path of the directory to list.public int sendList(java.lang.String path) throws CommandException
path
- the path of the directory to list.private void listFile(java.io.File file, java.io.PrintWriter writer)
file
- the file to list.writer
- the writer to print to.private static java.lang.String pad(int length)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |