|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.globus.ftp.FTPClient
org.globus.ftp.GridFTPClient
This is the main user interface for GridFTP operations.
Use this class for client - server or third party transfers
with mode E, parallelism, markers, striping or GSI authentication.
Consult the manual for general usage.
Note: If using with GridFTP servers operations like
setMode()
, setType()
,
setDataChannelProtection()
,
and setDataChannelAuthentication()
that affect data channel settings
must be called before passive or active data channel mode is set.
Field Summary | |
protected GridFTPServerFacade |
gLocalServer
|
protected GridFTPSession |
gSession
|
Fields inherited from class org.globus.ftp.FTPClient |
controlChannel, dateFormat, localServer, session, useAllo, username |
Constructor Summary | |
GridFTPClient(String host,
int port)
Constructs client and connects it to the remote server. |
Method Summary | |
void |
authenticate(GSSCredential credential)
Performs authentication with specified user credentials. |
void |
authenticate(GSSCredential credential,
String username)
Performs authentication with specified user credentials and a specific username (assuming the user dn maps to the passed username). |
protected void |
checkGridFTPSupport()
assure that the server supports extended transfer features; throw exception if not |
String |
checksum(ChecksumAlgorithm algorithm,
long offset,
long length,
String file)
Computes and returns a checksum of a file. |
protected void |
checkTransferParamsGet()
|
void |
extendedGet(String remoteFileName,
long size,
DataSink sink,
MarkerListener mListener)
Performs extended retrieve (partial retrieve mode starting at offset 0). |
void |
extendedGet(String remoteFileName,
long offset,
long size,
DataSink sink,
MarkerListener mListener)
Performs extended retrieve (partial retrieve mode). |
void |
extendedMultipleTransfer(long[] remoteSrcFileOffset,
long[] remoteSrcFileLength,
String[] remoteSrcFile,
GridFTPClient destination,
long[] remoteDstFileOffset,
String[] remoteDstFile,
MarkerListener mListener,
MultipleTransferCompleteListener doneListener)
|
void |
extendedMultipleTransfer(String[] remoteSrcFile,
GridFTPClient destination,
String[] remoteDstFile,
MarkerListener mListener,
MultipleTransferCompleteListener doneListener)
|
void |
extendedPut(String remoteFileName,
DataSource source,
MarkerListener mListener)
Performs extended store (adujsted store mode with offset 0). |
void |
extendedPut(String remoteFileName,
long offset,
DataSource source,
MarkerListener mListener)
Performs extended store (adujsted store mode). |
void |
extendedTransfer(String remoteSrcFile,
GridFTPClient destination,
String remoteDstFile,
MarkerListener mListener)
Performs a third-party transfer between two servers using extended block mode. |
void |
extendedTransfer(String remoteSrcFile,
long remoteSrcFileOffset,
long remoteSrcFileLength,
GridFTPClient destination,
String remoteDstFile,
long remoteDstFileOffset,
MarkerListener mListener)
Performs a third-party transfer between two servers using extended block mode. |
void |
get(String remoteFileName,
File localFile)
|
Authorization |
getAuthorization()
Returns authorization method for the control channel. |
int |
getControlChannelProtection()
Returns control channel protection level. |
DataChannelAuthentication |
getDataChannelAuthentication()
Returns data channel authentication mode (DCAU). |
int |
getDataChannelProtection()
Returns data channel protection level. |
Vector |
list(String filter,
String modifier)
Performs remote directory listing like FTPClient.list() . |
protected void |
listCheck()
check performed at the beginning of list() |
Vector |
mlsd(String filter)
Performs remote directory listing like FTPClient.mlsd() . |
Vector |
nlist(String path)
Performs remote directory listing like FTPClient.nlist() . |
void |
put(File localFile,
String remoteFileName,
boolean append)
|
void |
setAuthorization(Authorization authorization)
Sets authorization method for the control channel. |
void |
setChecksum(ChecksumAlgorithm algorithm,
String value)
Sets the checksum values ahead of the transfer |
void |
setControlChannelProtection(int protection)
Sets control channel protection level. |
void |
setDataChannelAuthentication(DataChannelAuthentication type)
Sets data channel authentication mode (DCAU) |
void |
setDataChannelProtection(int protection)
Sets data channel protection level (PROT). |
void |
setLocalNoDataChannelAuthentication()
Sets compatibility mode with old GSIFTP server. |
void |
setLocalStripedActive()
Starts local server in striped active mode. |
HostPortList |
setLocalStripedPassive()
Behaves like setLocalStripedPassive(FTPServerFacade.ANY_PORT, FTPServerFacade.DEFAULT_QUEUE) |
HostPortList |
setLocalStripedPassive(int port,
int queue)
Starts local server in striped passive mode. |
void |
setLocalTCPBufferSize(int size)
Sets local TCP buffer size (for both receiving and sending). |
void |
setMode(int mode)
Sets transfer mode. |
void |
setStripedActive(HostPortList hpl)
Sets remote server to striped active server mode (SPOR). |
HostPortList |
setStripedPassive()
Sets remote server to striped passive server mode (SPAS). |
void |
setTCPBufferSize(int size)
Sets remote server TCP buffer size, in the following way: First see if server supports "SBUF" and if so, use it. |
Methods inherited from class org.globus.ftp.FTPClient |
abort, actualSetMode, allocate, asynchGet, asynchPut, asynchPut, authorize, changeDir, checkTransferParams, checkTransferParamsPut, close, close, deleteDir, deleteFile, exists, get, getCurrentDir, getFeatureList, getHost, getLastModified, getLastReply, getPort, getSize, getUseAllo, getUserName, goUpDir, isActiveMode, isFeatureSupported, isPassiveMode, lastModified, list, list, list, makeDir, mlsd, mlsd, mlst, nlist, nlist, performTransfer, put, put, quote, rename, setActive, setActive, setClientWaitParams, setLocalActive, setLocalPassive, setLocalPassive, setOptions, setPassive, setPassiveMode, setProtectionBufferSize, setRestartMarker, setType, setUseAllo, site, size, transfer, transferBegin, transferRun, transferRunSingleThread, transferStart, transferWait |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected GridFTPSession gSession
protected GridFTPServerFacade gLocalServer
Constructor Detail |
public GridFTPClient(String host, int port) throws IOException, ServerException
host
- remote server hostport
- remote server portMethod Detail |
public void authenticate(GSSCredential credential) throws IOException, ServerException
credential
- user credentials to use.
IOException
- on i/o error
ServerException
- on server refusal or faulty server behaviorpublic void authenticate(GSSCredential credential, String username) throws IOException, ServerException
credential
- user credentials to use.username
- specific username to authenticate as.
IOException
- on i/o error
ServerException
- on server refusal or faulty server behaviorpublic Vector list(String filter, String modifier) throws ServerException, ClientException, IOException
FTPClient.list()
.
Note: This method cannot be used
in conjunction with parallelism or striping; set parallelism to
1 before calling it. Otherwise, use
FTPClient.list()
.
Unlike in vanilla FTP, here IMAGE mode is allowed.
For more documentation, look at FTPClient.
list
in class FTPClient
filter
- "*" for example, can be null.modifier
- "-d" for example, can be null.
FileInfo
objects, representing
remote files
ServerException
ClientException
IOException
FTPClient.mlsd(String)
public Vector nlist(String path) throws ServerException, ClientException, IOException
FTPClient.nlist()
.
Note: This method cannot be used
in conjunction with parallelism or striping; set parallelism to
1 before calling it. Otherwise, use
FTPClient.nlist()
.
Unlike in vanilla FTP, here IMAGE mode is allowed.
For more documentation, look at FTPClient.
nlist
in class FTPClient
path
- directory to perform listing of. If null, listing
of current directory will be performed.
FileInfo
objects, representing
remote files
ServerException
ClientException
IOException
public Vector mlsd(String filter) throws ServerException, ClientException, IOException
FTPClient.mlsd()
.
Note: This method cannot be used
in conjunction with parallelism or striping; set parallelism to
1 before calling it. Otherwise, use
FTPClient.mlsd()
.
Unlike in vanilla FTP, here IMAGE mode is allowed.
For more documentation, look at FTPClient.
mlsd
in class FTPClient
filter
- directory to perform listing of. If null, listing
of current directory will be performed.
MlsxEntry
objects, representing
remote files
ServerException
ClientException
IOException
protected void listCheck() throws ClientException
FTPClient
listCheck
in class FTPClient
ClientException
protected void checkTransferParamsGet() throws ServerException, IOException, ClientException
checkTransferParamsGet
in class FTPClient
ServerException
IOException
ClientException
public void setMode(int mode) throws IOException, ServerException
setMode
in class FTPClient
mode
- should be MODE_STREAM
,
MODE_BLOCK
, or
MODE_EBLOCK
IOException
ServerException
public void setTCPBufferSize(int size) throws IOException, ServerException
IOException
ServerException
public void setLocalTCPBufferSize(int size) throws ClientException
ClientException
public HostPortList setStripedPassive() throws IOException, ServerException
IOException
ServerException
public void setStripedActive(HostPortList hpl) throws IOException, ServerException
IOException
ServerException
public HostPortList setLocalStripedPassive(int port, int queue) throws IOException
port
- required server port; can be set to FTPServerFacade.ANY_PORTqueue
- max size of queue of awaiting new data channel connection
requests
IOException
public HostPortList setLocalStripedPassive() throws IOException
IOException
public void setLocalStripedActive() throws ClientException, IOException
ClientException
IOException
public void extendedGet(String remoteFileName, long size, DataSink sink, MarkerListener mListener) throws IOException, ClientException, ServerException
remoteFileName
- file to retrievesize
- number of bytes of remote file to transmitsink
- data sink to store the filemListener
- marker listener
IOException
ClientException
ServerException
public void extendedGet(String remoteFileName, long offset, long size, DataSink sink, MarkerListener mListener) throws IOException, ClientException, ServerException
remoteFileName
- file to retrieveoffset
- the staring offset in the remote filesize
- number of bytes of remote file to transmitsink
- data sink to store the filemListener
- marker listener
IOException
ClientException
ServerException
public void extendedPut(String remoteFileName, DataSource source, MarkerListener mListener) throws IOException, ServerException, ClientException
remoteFileName
- file name to storesource
- source for the data to transfermListener
- marker listener
IOException
ServerException
ClientException
public void extendedPut(String remoteFileName, long offset, DataSource source, MarkerListener mListener) throws IOException, ServerException, ClientException
remoteFileName
- file name to storeoffset
- the offset added to the file pointer before storing
the blocks of the file.source
- source for the data to transfermListener
- marker listener
IOException
ServerException
ClientException
public void extendedTransfer(String remoteSrcFile, GridFTPClient destination, String remoteDstFile, MarkerListener mListener) throws IOException, ServerException, ClientException
remoteSrcFile
- source filenamedestination
- destination serverremoteDstFile
- destination filenamemListener
- transer progress listener.
Can be set to null.
IOException
ServerException
ClientException
public void extendedTransfer(String remoteSrcFile, long remoteSrcFileOffset, long remoteSrcFileLength, GridFTPClient destination, String remoteDstFile, long remoteDstFileOffset, MarkerListener mListener) throws IOException, ServerException, ClientException
remoteSrcFile
- source filenameremoteSrcFileOffset
- source filename offsetremoteSrcFileLength
- source filename length to transferdestination
- destination serverremoteDstFile
- destination filenameremoteDstFileOffset
- destination filename offsetmListener
- transer progress listener.
Can be set to null.
IOException
ServerException
ClientException
public void extendedMultipleTransfer(long[] remoteSrcFileOffset, long[] remoteSrcFileLength, String[] remoteSrcFile, GridFTPClient destination, long[] remoteDstFileOffset, String[] remoteDstFile, MarkerListener mListener, MultipleTransferCompleteListener doneListener) throws IOException, ServerException, ClientException
IOException
ServerException
ClientException
public void extendedMultipleTransfer(String[] remoteSrcFile, GridFTPClient destination, String[] remoteDstFile, MarkerListener mListener, MultipleTransferCompleteListener doneListener) throws IOException, ServerException, ClientException
IOException
ServerException
ClientException
protected void checkGridFTPSupport() throws IOException, ServerException
IOException
ServerException
public void setDataChannelAuthentication(DataChannelAuthentication type) throws IOException, ServerException
type
- for 2-party transfer must be
DataChannelAuthentication.SELF or DataChannelAuthentication.NONE
IOException
ServerException
public void setLocalNoDataChannelAuthentication()
public DataChannelAuthentication getDataChannelAuthentication()
public void setDataChannelProtection(int protection) throws IOException, ServerException
protection
- should be
CLEAR
,
SAFE
, or
PRIVATE
, or
CONFIDENTIAL
.
IOException
ServerException
public int getDataChannelProtection()
CLEAR
,
SAFE
, or
PRIVATE
, or
CONFIDENTIAL
.public void setAuthorization(Authorization authorization)
authorization
- authorization method.public Authorization getAuthorization()
public void setControlChannelProtection(int protection)
protection
- should be
CLEAR
,
SAFE
, or
PRIVATE
, or
CONFIDENTIAL
.public int getControlChannelProtection()
CLEAR
,
SAFE
, or
PRIVATE
, or
CONFIDENTIAL
.public void get(String remoteFileName, File localFile) throws IOException, ClientException, ServerException
get
in class FTPClient
IOException
ClientException
ServerException
public void put(File localFile, String remoteFileName, boolean append) throws IOException, ServerException, ClientException
put
in class FTPClient
IOException
ServerException
ClientException
public void setChecksum(ChecksumAlgorithm algorithm, String value) throws IOException, ServerException
algorithm
- the checksume algorithmvalue
- the checksum value as hexadecimal number
ServerException
- if an error occured.
IOException
public String checksum(ChecksumAlgorithm algorithm, long offset, long length, String file) throws IOException, ServerException
algorithm
- the checksume algorithmoffset
- the offsetlength
- the lengthfile
- file to compute checksum of
ServerException
- if an error occured.
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |