Class TFTPExample
- java.lang.Object
-
- org.apache.commons.net.examples.ftp.TFTPExample
-
public final class TFTPExample extends java.lang.Object
This is an example of a simple Java TFTP client. Notice how all the code is really just argument processing and error handling.Usage: TFTPExample [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 Modifier and Type Field Description (package private) static java.lang.String
USAGE
-
Constructor Summary
Constructors Constructor Description TFTPExample()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static boolean
close(TFTPClient tftp, java.io.Closeable output)
static void
main(java.lang.String[] args)
private static void
open(TFTPClient tftp)
private static boolean
receive(int transferMode, java.lang.String hostname, java.lang.String localFilename, java.lang.String remoteFilename, TFTPClient tftp)
private static boolean
send(int transferMode, java.lang.String hostname, java.lang.String localFilename, java.lang.String remoteFilename, TFTPClient tftp)
-
-
-
Field Detail
-
USAGE
static final java.lang.String USAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
close
private static boolean close(TFTPClient tftp, java.io.Closeable output)
-
main
public static void main(java.lang.String[] args) throws java.io.IOException
- Throws:
java.io.IOException
-
open
private static void open(TFTPClient tftp) throws java.io.IOException
- Throws:
java.io.IOException
-
receive
private static boolean receive(int transferMode, java.lang.String hostname, java.lang.String localFilename, java.lang.String remoteFilename, TFTPClient tftp) throws java.io.IOException
- Throws:
java.io.IOException
-
send
private static boolean send(int transferMode, java.lang.String hostname, java.lang.String localFilename, java.lang.String remoteFilename, TFTPClient tftp) throws java.io.IOException
- Throws:
java.io.IOException
-
-