org.jutil
Class TFTP

java.lang.Object
  extended by org.jutil.TFTP

public final class TFTP
extends java.lang.Object

This is the TFTP utility code class. 17/08/2001 Removed UnknownUserException and InvalidPasswordExceptions to hide some details from any hacker. Replaced with GeneralSecurityException pb...


Constructor Summary
TFTP()
          Ensure that no one can create instances of this Class.
 
Method Summary
static void send(FTPFileDescriptor ftpFileDescriptor, java.lang.String user, java.lang.String pass, java.io.File source)
          Send a file to host in descriptor
static void send(FTPFileDescriptor ftpFileDescriptor, java.lang.String user, java.lang.String pass, java.io.File source, boolean debug)
          Send a file to host in descriptor
static void send(FTPFileDescriptor ftpFileDescriptor, java.lang.String user, java.lang.String pass, java.io.File source, IOMonitor ioMonitor, boolean debug)
          Send a file to host in descriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TFTP

public TFTP()
Ensure that no one can create instances of this Class.

Method Detail

send

public static final void send(FTPFileDescriptor ftpFileDescriptor,
                              java.lang.String user,
                              java.lang.String pass,
                              java.io.File source)
                       throws java.rmi.UnknownHostException,
                              java.security.GeneralSecurityException,
                              java.io.IOException
Send a file to host in descriptor

FTPFileDescriptor ftpFileDescriptor = FTPFileDescriptorFactory.create( 123.465.789.123, // host "images", // destination dir "myfile.txt", // dest filename FTPConst.MODE_ASCII, // node FTPConst.MODE_ASCII / FTPConst.MODE_BINARY true); // overwrite true/false TFTP.send(ftpFileDescriptor, "myUserID", "myPass", new File("myfile.txt"));

Throws:
java.rmi.UnknownHostException
java.security.GeneralSecurityException
java.io.IOException

send

public static final void send(FTPFileDescriptor ftpFileDescriptor,
                              java.lang.String user,
                              java.lang.String pass,
                              java.io.File source,
                              boolean debug)
                       throws java.rmi.UnknownHostException,
                              java.security.GeneralSecurityException,
                              java.io.IOException
Send a file to host in descriptor

FTPFileDescriptor ftpFileDescriptor = FTPFileDescriptorFactory.create( 123.465.789.123, // host "images", // destination dir "myfile.txt", // dest filename FTPConst.MODE_ASCII, // node FTPConst.MODE_ASCII / FTPConst.MODE_BINARY true); // overwrite true/false TFTP.send(ftpFileDescriptor, "myUserID", "myPass", new File("myfile.txt"), debug);

Throws:
java.rmi.UnknownHostException
java.security.GeneralSecurityException
java.io.IOException

send

public static final void send(FTPFileDescriptor ftpFileDescriptor,
                              java.lang.String user,
                              java.lang.String pass,
                              java.io.File source,
                              IOMonitor ioMonitor,
                              boolean debug)
                       throws java.rmi.UnknownHostException,
                              java.security.GeneralSecurityException,
                              java.io.IOException
Send a file to host in descriptor

FTPFileDescriptor ftpFileDescriptor = FTPFileDescriptorFactory.create( 123.465.789.123, // host "images", // destination dir "myfile.txt", // dest filename FTPConst.MODE_ASCII, // node FTPConst.MODE_ASCII / FTPConst.MODE_BINARY true); // overwrite true/false TFTP.send(ftpFileDescriptor, "myUserID", "myPass", new File("myfile.txt"), new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))), debug);

Throws:
java.rmi.UnknownHostException
java.security.GeneralSecurityException
java.io.IOException