rheise.jftpd
Class TransmissionMode

java.lang.Object
  |
  +--rheise.jftpd.TransmissionMode
Direct Known Subclasses:
StreamTransmissionMode

public abstract class TransmissionMode
extends java.lang.Object

Subclasses of TransmissionMode handle the sending or receiving of files in different transmission modes.


Field Summary
private  char code
          The character code for this transmission mode.
static TransmissionMode STREAM
          The STREAM transmission mode.
private static java.util.Hashtable transmissionModes
          A code to transmission mode map.
 
Constructor Summary
protected TransmissionMode(char code)
           
 
Method Summary
static TransmissionMode get(char code)
           
 char getCode()
           
abstract  void receiveFile(java.net.Socket s, java.io.OutputStream out, Representation representation)
          Reads data from the given socket and converts it from the specified representation to local representation, writing the result to a file via "out".
abstract  void sendFile(java.io.InputStream in, java.net.Socket s, Representation representation)
          Reads the contents of the file from "in", and writes the data to the given socket using the specified representation.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

transmissionModes

private static java.util.Hashtable transmissionModes
A code to transmission mode map.

STREAM

public static final TransmissionMode STREAM
The STREAM transmission mode.

code

private char code
The character code for this transmission mode.
Constructor Detail

TransmissionMode

protected TransmissionMode(char code)
Method Detail

get

public static TransmissionMode get(char code)
Returns:
the TransmissionMode indicated by the code argument.

getCode

public final char getCode()
Returns:
the character code for this transmission mode.

sendFile

public abstract void sendFile(java.io.InputStream in,
                              java.net.Socket s,
                              Representation representation)
                       throws java.io.IOException
Reads the contents of the file from "in", and writes the data to the given socket using the specified representation.

receiveFile

public abstract void receiveFile(java.net.Socket s,
                                 java.io.OutputStream out,
                                 Representation representation)
                          throws java.io.IOException
Reads data from the given socket and converts it from the specified representation to local representation, writing the result to a file via "out".