Class TFTPExample
java.lang.Object
org.apache.commons.net.examples.ftp.TFTPExample
This is an example of a simple Java tftp client. Notice how all of the code is really just argument processing and error handling.
Usage: tftp [options] hostname localfile remotefile hostname - The name of the remote host, with optional :port localfile - The name of the local file to send or the name to use for the received file remotefile - The name of the remote file to receive or the name for the remote server to use to name the local file being sent. options: (The default is to assume -r -b) -s Send a local file -r Receive a remote file -a Use ASCII transfer mode -b Use binary transfer mode
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
close
(TFTPClient tftp, Closeable output) static void
private static void
open
(TFTPClient tftp) private static boolean
receive
(int transferMode, String hostname, String localFilename, String remoteFilename, TFTPClient tftp) private static boolean
send
(int transferMode, String hostname, String localFilename, String remoteFilename, TFTPClient tftp)
-
Field Details
-
USAGE
- See Also:
-
-
Constructor Details
-
TFTPExample
public TFTPExample()
-
-
Method Details
-
close
-
main
-
open
-
receive
private static boolean receive(int transferMode, String hostname, String localFilename, String remoteFilename, TFTPClient tftp) -
send
private static boolean send(int transferMode, String hostname, String localFilename, String remoteFilename, TFTPClient tftp)
-