org.nees.util
Class TransferFacade

java.lang.Object
  extended byorg.nees.util.TransferFacade
Direct Known Subclasses:
FTPFacade, LocalFileTransferFacade

public abstract class TransferFacade
extends java.lang.Object

This class implements methods for a transfer protocol, specifically putting, getting and appending files.

Created on April 14, 2004, 11:10 AM

Author:
Jeff Gaynor

Constructor Summary
TransferFacade()
           
 
Method Summary
abstract  void append(java.io.File localFragment, java.lang.String remoteFile)
          Get a client, authenticate, append to a file on the server, and close the client.
abstract  void append(java.io.File localFragment, java.lang.String remoteDir, java.lang.String remoteFile)
           
abstract  void append(java.io.File localFragment, java.net.URI remoteURI)
           
abstract  void get(java.lang.String remoteFile, java.io.File localFile)
          Get a client, authenticate, get a file, and close the client.
abstract  void get(java.lang.String remoteDir, java.lang.String remoteFile, java.io.File localFile)
          Get a client, authenticate, get a file, and close the client.
abstract  void get(java.net.URI remoteURI, java.io.File localFile)
           
abstract  void put(java.io.File localFile, java.lang.String remoteFile)
          Get a client, authenticate, put a file to the server, and close the client.
abstract  void put(java.io.File localFile, java.lang.String remoteDir, java.lang.String remoteFile)
           
abstract  void put(java.io.File localFile, java.net.URI remoteURI)
          Get a client, authenticate, append to a file on the server, and close the client.
static java.lang.String[] splitPath(java.net.URI uri)
          A utility method for tokenizing a URI into directory and name components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransferFacade

public TransferFacade()
Method Detail

append

public abstract void append(java.io.File localFragment,
                            java.lang.String remoteDir,
                            java.lang.String remoteFile)
                     throws java.lang.Exception
Throws:
java.lang.Exception

append

public abstract void append(java.io.File localFragment,
                            java.lang.String remoteFile)
                     throws java.lang.Exception
Get a client, authenticate, append to a file on the server, and close the client.

Parameters:
localFragment - the file fragment to append
remoteFile - the remote file name
Throws:
java.lang.Exception

append

public abstract void append(java.io.File localFragment,
                            java.net.URI remoteURI)
                     throws java.lang.Exception
Throws:
java.lang.Exception

get

public abstract void get(java.lang.String remoteDir,
                         java.lang.String remoteFile,
                         java.io.File localFile)
                  throws java.lang.Exception
Get a client, authenticate, get a file, and close the client.

Parameters:
remoteDir - the remote directory
localFile - the file to store the results in
Throws:
java.lang.Exception

get

public abstract void get(java.lang.String remoteFile,
                         java.io.File localFile)
                  throws java.lang.Exception
Get a client, authenticate, get a file, and close the client. The file will be retrieved from the user's default directory on the server.

Parameters:
localFile - the file to store the results in
Throws:
java.lang.Exception

get

public abstract void get(java.net.URI remoteURI,
                         java.io.File localFile)
                  throws java.lang.Exception
Throws:
java.lang.Exception

put

public abstract void put(java.io.File localFile,
                         java.lang.String remoteDir,
                         java.lang.String remoteFile)
                  throws java.lang.Exception
Throws:
java.lang.Exception

put

public abstract void put(java.io.File localFile,
                         java.lang.String remoteFile)
                  throws java.lang.Exception
Get a client, authenticate, put a file to the server, and close the client. The file will be put in the default directory for the user on the server.

Parameters:
localFile - the file to put
remoteFile - the remote file name
Throws:
java.lang.Exception

put

public abstract void put(java.io.File localFile,
                         java.net.URI remoteURI)
                  throws java.lang.Exception
Get a client, authenticate, append to a file on the server, and close the client.

Throws:
java.lang.Exception

splitPath

public static java.lang.String[] splitPath(java.net.URI uri)
A utility method for tokenizing a URI into directory and name components. This is pretty simple minded and just looks on the path for the last separator character and chops up the path there.