| java.lang.Object org.apache.commons.net.tftp.TFTPPacket org.apache.commons.net.tftp.TFTPRequestPacket
All known Subclasses: org.apache.commons.net.tftp.TFTPWriteRequestPacket, org.apache.commons.net.tftp.TFTPReadRequestPacket,
Field Summary | |
String | _filename The filename of the request. | int | _mode The transfer mode of the request. | final static byte[] | _modeBytes A null terminated byte array representation of the ascii names of the
transfer mode constants. | final static String[] | _modeStrings An array containing the string names of the transfer modes and indexed
by the transfer mode constants. |
Constructor Summary | |
| TFTPRequestPacket(InetAddress destination, int port, int type, String filename, int mode) Creates a request packet of a given type to be sent to a host at a
given port with a filename and transfer mode request.
Parameters: destination - The host to which the packet is going to be sent. Parameters: port - The port to which the packet is going to be sent. Parameters: type - The type of the request (either TFTPPacket.READ_REQUEST orTFTPPacket.WRITE_REQUEST). Parameters: filename - The requested filename. Parameters: mode - The requested transfer mode. | | TFTPRequestPacket(int type, DatagramPacket datagram) Creates a request packet of a given type based on a received
datagram. |
Method Summary | |
final DatagramPacket | _newDatagram(DatagramPacket datagram, byte[] data) This is a method only available within the package for
implementing efficient datagram transport by elminating buffering.
It takes a datagram as an argument, and a byte buffer in which
to store the raw datagram data. | final public String | getFilename() Returns the requested filename. | final public int | getMode() Returns the transfer mode of the request. | final public DatagramPacket | newDatagram() Creates a UDP datagram containing all the TFTP
request packet data in the proper format.
This is a method exposed to the programmer in case he
wants to implement his own TFTP client instead of using
the
org.apache.commons.net.tftp.TFTPClient class. |
_filename | String _filename(Code) | | The filename of the request. **
|
_mode | int _mode(Code) | | The transfer mode of the request. **
|
_modeBytes | final static byte[] _modeBytes(Code) | | A null terminated byte array representation of the ascii names of the
transfer mode constants. This is convenient for creating the TFTP
request packets.
|
_modeStrings | final static String[] _modeStrings(Code) | | An array containing the string names of the transfer modes and indexed
by the transfer mode constants.
|
TFTPRequestPacket | TFTPRequestPacket(InetAddress destination, int port, int type, String filename, int mode)(Code) | | Creates a request packet of a given type to be sent to a host at a
given port with a filename and transfer mode request.
Parameters: destination - The host to which the packet is going to be sent. Parameters: port - The port to which the packet is going to be sent. Parameters: type - The type of the request (either TFTPPacket.READ_REQUEST orTFTPPacket.WRITE_REQUEST). Parameters: filename - The requested filename. Parameters: mode - The requested transfer mode. This should be on of the TFTPclass MODE constants (e.g., TFTP.NETASCII_MODE). |
TFTPRequestPacket | TFTPRequestPacket(int type, DatagramPacket datagram) throws TFTPPacketException(Code) | | Creates a request packet of a given type based on a received
datagram. Assumes the datagram is at least length 4, else an
ArrayIndexOutOfBoundsException may be thrown.
Parameters: type - The type of the request (either TFTPPacket.READ_REQUEST orTFTPPacket.WRITE_REQUEST). Parameters: datagram - The datagram containing the received request. throws: TFTPPacketException - If the datagram isn't a valid TFTPrequest packet of the appropriate type. |
_newDatagram | final DatagramPacket _newDatagram(DatagramPacket datagram, byte[] data)(Code) | | This is a method only available within the package for
implementing efficient datagram transport by elminating buffering.
It takes a datagram as an argument, and a byte buffer in which
to store the raw datagram data. Inside the method, the data
is set as the datagram's data and the datagram returned.
Parameters: datagram - The datagram to create. Parameters: data - The buffer to store the packet and to use in the datagram. The datagram argument. |
getFilename | final public String getFilename()(Code) | | Returns the requested filename.
The requested filename. |
getMode | final public int getMode()(Code) | | Returns the transfer mode of the request.
The transfer mode of the request. |
newDatagram | final public DatagramPacket newDatagram()(Code) | | Creates a UDP datagram containing all the TFTP
request packet data in the proper format.
This is a method exposed to the programmer in case he
wants to implement his own TFTP client instead of using
the
org.apache.commons.net.tftp.TFTPClient class. Under normal circumstances, you should not have a need to call
this method.
A UDP datagram containing the TFTP request packet. |
|
|