Package org.apache.commons.net.tftp
Class TFTPRequestPacket
java.lang.Object
org.apache.commons.net.tftp.TFTPPacket
org.apache.commons.net.tftp.TFTPRequestPacket
- Direct Known Subclasses:
TFTPReadRequestPacket,TFTPWriteRequestPacket
An abstract class derived from TFTPPacket definiing a TFTP Request packet type. It is subclassed by the
TFTPReadRequestPacket and TFTPWriteRequestPacket classes.
Details regarding the TFTP protocol and the format of TFTP packets can be found in RFC 783. But the point of these classes is to keep you from having to
worry about the internals. Additionally, only very few people should have to care about any of the TFTPPacket classes or derived classes. Almost all users
should only be concerned with the TFTPClient class receiveFile() and sendFile() methods.
- See Also:
-
Field Summary
Fields inherited from class org.apache.commons.net.tftp.TFTPPacket
ACKNOWLEDGEMENT, DATA, ERROR, OACK, READ_REQUEST, SEGMENT_SIZE, WRITE_REQUEST -
Method Summary
Modifier and TypeMethodDescriptionfinal StringGets the requested file name.final intgetMode()Gets the transfer mode of the request.Gets the options extensions of the request as a map.final DatagramPacketCreates a UDP datagram containing all the TFTP request packet data in the proper format.Methods inherited from class org.apache.commons.net.tftp.TFTPPacket
getAddress, getPort, getType, newTFTPPacket, setAddress, setPort, toString
-
Method Details
-
getFilename
Gets the requested file name.- Returns:
- The requested file name.
-
getMode
Gets the transfer mode of the request.- Returns:
- The transfer mode of the request.
-
getOptions
Gets the options extensions of the request as a map. The keys are the option names and the values are the option values.- Returns:
- The options extensions of the request as a map.
- Since:
- 3.12.0
-
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 theTFTPClientclass. Under normal circumstances, you should not have a need to call this method.- Specified by:
newDatagramin classTFTPPacket- Returns:
- A UDP datagram containing the TFTP request packet.
-