GridFTPClient (Java Globus API)

org.globus.io.ftp
Class GridFTPClient

java.lang.Object
  |
  +--org.globus.io.ftp.FTPCommon
        |
        +--org.globus.io.ftp.FTPClient
              |
              +--org.globus.io.ftp.GSIFTPClient
                    |
                    +--org.globus.io.ftp.GridFTPClient

public class GridFTPClient
extends GSIFTPClient


Field Summary
 
Fields inherited from class org.globus.io.ftp.GSIFTPClient
authorization, gssin, gssout
 
Fields inherited from class org.globus.io.ftp.FTPClient
_dateFormat, BUFF_SIZE, bufferSize, compatibilityMode, dataChannelPort, localBufferSize, passiveMode, type
 
Fields inherited from class org.globus.io.ftp.FTPCommon
ASCII, BINARY, ftpin, ftpout, host, NLST, PERMANENT_NEGATIVE_REPLY, port, POSITIVE_COMPLETION_REPLY, POSITIVE_INTERMEDIATE_REPLY, POSITIVE_PRELIMINARY_REPLY, requestThread, RETR, socket, TIMEOUT, TRANSIENT_NEGATIVE_REPLY
 
Constructor Summary
GridFTPClient(java.lang.String host, int port)
          Connects to the GridFTP serverSocket on given host and port number.
 
Method Summary
 void authenticate(GlobusProxy proxy)
          Performs authentication with specified user credentials.
 java.net.Socket authenticateDataChannel(java.net.Socket clientSocket)
           
protected  java.net.Socket authenticateDataChannel(java.net.Socket simpleSocket, GlobusProxy proxy)
           
protected  java.net.Socket authenticateDataChannel(java.net.Socket simpleSocket, GlobusProxy proxy, java.lang.String subject)
           
 void copy(java.lang.String remoteSrcFile, FTPClient dstServer, java.lang.String remoteDstFile, boolean append, TransferProgressListener listener)
          Performs a third-party transfer between two servers.
 java.net.Socket executeStreamCommand(java.lang.String command, java.lang.String args)
           
 void get(java.lang.String remoteFile, java.io.File localFile, TransferProgressListener progressListener)
          Retreives a file from ftp server and saves it in a local file.
 GlobusProxy getCredentials()
           
 int getProtectedBufferSize()
           
 boolean isDataChannelAuthentication()
           
 boolean isDataChannelProtection()
           
 java.util.Vector list(java.lang.String filter)
          Performs list function with specified filter.
 java.util.Vector nlist(java.lang.String filter)
          Performs nlist function with specified filter.
 void setCredentials(GlobusProxy credentials)
           
 void setDataChannelAuthentication(boolean dataChannelAuthentication)
           
 void setDataChannelAuthentication(boolean dataChannelAuthentication, java.lang.String subject)
           
 void setDataChannelProtection(boolean dataChannelProtection)
           
 void setProtectedBufferSize(int protectedBufferSize)
           
 
Methods inherited from class org.globus.io.ftp.GSIFTPClient
authenticate, authenticate, connect, getAuthorization, getReply, setAuthorization
 
Methods inherited from class org.globus.io.ftp.FTPClient
changeDir, closeSockets, closeStreams, copy, deleteDir, deleteFile, exists, features, get, getBufferSize, getCurrentDir, getLocalBufferSize, goUpDir, isFeatureSupported, isInCompatibilityMode, isPassiveMode, lastModified, list, makeDir, mGet, mPut, put, put, rename, setBufferSize, setCompatibilityMode, setDataChannelPort, setLocalBufferSize, setPassiveMode, setRemoteBufferSize, setRestartMarker, setSocketBufferSize, setType, setupServers, size, transfer, transferASCII, transferData
 
Methods inherited from class org.globus.io.ftp.FTPCommon
abort, checkResponse, close, closeSocket, disconnect, doCmd, doCmd, executeCommand, getControlSocket, getReply, getRequestThread, getResponse, isPositiveComplete, isPositivePreliminary, isReplyType, readLine, sendFileCommand, setPassiveMode, setPort, startDataChannel, startDataChannel, startPassiveDataChannel, write, writeln
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridFTPClient

public GridFTPClient(java.lang.String host,
                     int port)
              throws java.io.IOException,
                     FTPException
Connects to the GridFTP serverSocket on given host and port number.

Parameters:
host - hostname of the ftp serverSocket
port - port number of the ftp serverSocket
Method Detail

authenticate

public void authenticate(GlobusProxy proxy)
                  throws java.io.IOException,
                         FTPException
Performs authentication with specified user credentials.

Overrides:
authenticate in class GSIFTPClient
Parameters:
proxy - user credentials to use.
java.io.IOException
FTPException

setDataChannelAuthentication

public void setDataChannelAuthentication(boolean dataChannelAuthentication)
                                  throws java.io.IOException,
                                         FTPException
java.io.IOException
FTPException

setDataChannelAuthentication

public void setDataChannelAuthentication(boolean dataChannelAuthentication,
                                         java.lang.String subject)
                                  throws java.io.IOException,
                                         FTPException
java.io.IOException
FTPException

setProtectedBufferSize

public void setProtectedBufferSize(int protectedBufferSize)

getProtectedBufferSize

public int getProtectedBufferSize()

setDataChannelProtection

public void setDataChannelProtection(boolean dataChannelProtection)
                              throws java.io.IOException,
                                     FTPException
java.io.IOException
FTPException

isDataChannelProtection

public boolean isDataChannelProtection()

isDataChannelAuthentication

public boolean isDataChannelAuthentication()

authenticateDataChannel

protected java.net.Socket authenticateDataChannel(java.net.Socket simpleSocket,
                                                  GlobusProxy proxy)
                                           throws java.io.IOException
java.io.IOException

authenticateDataChannel

protected java.net.Socket authenticateDataChannel(java.net.Socket simpleSocket,
                                                  GlobusProxy proxy,
                                                  java.lang.String subject)
                                           throws java.io.IOException
java.io.IOException

setCredentials

public void setCredentials(GlobusProxy credentials)

getCredentials

public GlobusProxy getCredentials()

authenticateDataChannel

public java.net.Socket authenticateDataChannel(java.net.Socket clientSocket)
                                        throws java.io.IOException
java.io.IOException

executeStreamCommand

public java.net.Socket executeStreamCommand(java.lang.String command,
                                            java.lang.String args)
                                     throws java.io.IOException,
                                            FTPException
Overrides:
executeStreamCommand in class FTPClient
java.io.IOException
FTPException

get

public void get(java.lang.String remoteFile,
                java.io.File localFile,
                TransferProgressListener progressListener)
         throws FTPException,
                java.io.IOException
Description copied from class: FTPClient
Retreives a file from ftp server and saves it in a local file.

Overrides:
get in class FTPClient
Parameters:
remoteFile - remote file name
localFile - local file name. If a file already exists it will be overwritten.
progressListener - transfer progress listener. Can be set to null.
Throws:
java.io.IOException - if the specified file is a directory or any other I/O problems occur during the transfer.
FTPException

list

public java.util.Vector list(java.lang.String filter)
                      throws java.io.IOException,
                             FTPException
Description copied from class: FTPClient
Performs list function with specified filter. It sends 'LIST -d' command. Performs list function. It sends 'LIST -d' command. Note: This function can only parse Unix ls -d output. If 'ls' is executed without -d option this function might fail. Also 'ls -d' output might be different on each architecture.

Overrides:
list in class FTPClient
Returns:
Vector list of FileInfo objects that satisfy given filter.
java.io.IOException
FTPException

nlist

public java.util.Vector nlist(java.lang.String filter)
                       throws java.io.IOException,
                              FTPException
Description copied from class: FTPClient
Performs nlist function with specified filter. It sends 'NLST' command that should be ftpd implementation independed. It is used for non-recursive mget() and copy() functions.

Overrides:
nlist in class FTPClient
Returns:
Vector list of FileInfo objects that satisfy given filter. The FileInfo objects will have no detailed info such as file size, owner, etc.
java.io.IOException
FTPException

copy

public void copy(java.lang.String remoteSrcFile,
                 FTPClient dstServer,
                 java.lang.String remoteDstFile,
                 boolean append,
                 TransferProgressListener listener)
          throws java.io.IOException,
                 FTPException
Description copied from class: FTPClient
Performs a third-party transfer between two servers. Note: This needs to be tested a lot for recovery from errors.

Overrides:
copy in class FTPClient
Parameters:
remoteSrcFile - source filename
dstServer - destination server
remoteDstFile - destination filename
append - enables append mode, if true file will be appened.
listener - transer progress listener. Can be set to null.
java.io.IOException
FTPException