Modifier and Type | Field and Description |
---|---|
protected boolean |
appendMode |
static int |
BUFF_SIZE
maximum buffer size to read or write when putting and getting files
|
protected int |
bufferSize |
protected boolean |
canceled |
protected boolean |
dcau |
protected long |
destinationOffset |
protected boolean |
disableAllo |
protected Authorization |
dstAuth |
protected GSSCredential |
dstCreds |
protected GlobusURL |
dstUrl |
protected List |
listeners |
protected long |
sourceLength |
protected long |
sourceOffset |
protected Authorization |
srcAuth |
protected GSSCredential |
srcCreds |
protected GlobusURL |
srcUrl |
protected int |
tcpBufferSize |
protected boolean |
thirdParty |
Constructor and Description |
---|
UrlCopy() |
Modifier and Type | Method and Description |
---|---|
void |
addUrlCopyListener(UrlCopyListener listener)
Adds url copy listener.
|
void |
cancel()
Cancels the transfer in progress.
|
void |
copy()
Performs the copy function.
|
int |
getBufferSize()
Returns buffer size used for transfering
data.
|
boolean |
getDCAU() |
Authorization |
getDestinationAuthorization()
Returns authorization type for
the destination side for the url copy.
|
GSSCredential |
getDestinationCredentials()
Returns credentials used for authenticating
the destination side for the url copy.
|
long |
getDestinationOffset()
Gets the offset in the destination file from which data starts
to be written
|
GlobusURL |
getDestinationUrl()
Returns destination url.
|
boolean |
getDisableAllo()
Can be used to query whether the use of the ALLO command
with GridFTP uploads is disabled.
|
protected GlobusInputStream |
getInputStream()
Returns input stream based on the source url
|
protected GlobusOutputStream |
getOutputStream(long size)
Returns output stream based on the destination url.
|
Authorization |
getSourceAuthorization()
Returns authorization type for
the source side for the url copy.
|
GSSCredential |
getSourceCredentials()
Returns credentials used for authenticating
the source side for the url copy.
|
long |
getSourceLength()
Gets the maximum data size that will be transfered.
|
long |
getSourceOffset()
Gets the offset in the source file from which data starts
to be read
|
GlobusURL |
getSourceUrl()
Returns source url.
|
int |
getTCPBufferSize()
Returns TCP buffer size used for transfers
data.
|
boolean |
isAppendMode()
Checks if append mode is enabled.
|
boolean |
isCanceled()
Checks if the transfer was canceled.
|
protected void |
negotiateDCAU(FTPClient src,
FTPClient dst) |
void |
removeUrlCopyListener(UrlCopyListener listener)
Remove url copy listener
|
void |
run()
This method is an implementation of the
Runnable interface
and can be used to perform the copy in a separate thread. |
void |
setAppendMode(boolean appendMode)
Enables/disables append mode.
|
void |
setBufferSize(int size)
Sets buffer size for transfering data.
|
void |
setCredentials(GSSCredential credentials)
Sets credentials to use for both sides.
|
void |
setDCAU(boolean dcau) |
void |
setDestinationAuthorization(Authorization auth)
Sets destination authorization type
|
void |
setDestinationCredentials(GSSCredential dstCredentials)
Sets destination url credentials.
|
void |
setDestinationOffset(long destinationOffset)
Sets the offset in the destination file from which data starts
to be written.
|
void |
setDestinationUrl(GlobusURL dest)
Sets destination url.
|
void |
setDisableAllo(boolean disableAllo)
Allows disabling of the use of ALLO with GridFTP
uploads
|
void |
setSourceAuthorization(Authorization auth)
Sets source authorization type
|
void |
setSourceCredentials(GSSCredential srcCredentials)
Sets source url credentials.
|
void |
setSourceFileLength(long sourceLength)
Allows a partial transfer by setting the maximum number of bytes
that will be transfered.
|
void |
setSourceFileOffset(long sourceOffset)
Sets the offset in the source file from which data starts
to be read.
|
void |
setSourceUrl(GlobusURL source)
Sets source url.
|
void |
setTCPBufferSize(int size)
Sets the TCP buffer size for GridFTP transfers.
|
void |
setUseThirdPartyCopy(boolean thirdParty)
Enables/disables usage of third party transfers.
|
public static final int BUFF_SIZE
protected int bufferSize
protected GSSCredential srcCreds
protected Authorization srcAuth
protected GSSCredential dstCreds
protected Authorization dstAuth
protected boolean dcau
protected boolean appendMode
protected GlobusURL srcUrl
protected GlobusURL dstUrl
protected boolean canceled
protected boolean thirdParty
protected List listeners
protected long sourceOffset
protected long destinationOffset
protected long sourceLength
protected int tcpBufferSize
protected boolean disableAllo
public void setDCAU(boolean dcau)
public boolean getDCAU()
public void setCredentials(GSSCredential credentials)
credentials
- user credentialspublic void setSourceCredentials(GSSCredential srcCredentials)
srcCredentials
- source url credentials.public void setDestinationCredentials(GSSCredential dstCredentials)
dstCredentials
- destination url credentials.public void setSourceAuthorization(Authorization auth)
auth
- authorization type to perform for sourcepublic void setDestinationAuthorization(Authorization auth)
auth
- authorization type to perform for destinationpublic GSSCredential getSourceCredentials()
public GSSCredential getDestinationCredentials()
public Authorization getSourceAuthorization()
public Authorization getDestinationAuthorization()
public void addUrlCopyListener(UrlCopyListener listener)
listener
- url copy listenerpublic void removeUrlCopyListener(UrlCopyListener listener)
listener
- url copy listenerpublic void setBufferSize(int size)
size
- size of the data bufferpublic int getBufferSize()
public void setTCPBufferSize(int size)
size
- size of TCP bufferpublic int getTCPBufferSize()
public void setAppendMode(boolean appendMode)
appendMode
- if true, destination file
will be appended.public boolean isAppendMode()
public long getDestinationOffset()
public void setDestinationOffset(long destinationOffset)
destinationOffset
- the offset in bytespublic long getSourceLength()
public void setSourceFileLength(long sourceLength)
sourceLength
- the size of the transfer in bytespublic long getSourceOffset()
public void setSourceFileOffset(long sourceOffset)
sourceOffset
- the offset in bytespublic void setSourceUrl(GlobusURL source) throws UrlCopyException
source
- source url.UrlCopyException
public GlobusURL getSourceUrl()
public void setDestinationUrl(GlobusURL dest) throws UrlCopyException
dest
- destination urlUrlCopyException
public GlobusURL getDestinationUrl()
public void setUseThirdPartyCopy(boolean thirdParty)
thirdParty
- if true enable, false disablepublic boolean getDisableAllo()
public void setDisableAllo(boolean disableAllo)
public void cancel()
public boolean isCanceled()
public void run()
Runnable
interface
and can be used to perform the copy in a separate thread.
This method will perform the transfer and signal completion and
errors through the UrlCopyListener.transferCompleted()
and
UrlCopyListener.transferError(Exception)
of any registered listeners
(see addUrlCopyListener(UrlCopyListener)
).
public void copy() throws UrlCopyException
This method does not cause the UrlCopyListener.transferCompleted()
and UrlCopyListener.transferError(Exception)
to be called. If you want
completion/failures to be signaled asynchronously, either call the
run()
method or wrap this object in a Thread
.
UrlCopyException
- in case of an error.protected GlobusInputStream getInputStream() throws Exception
Exception
protected GlobusOutputStream getOutputStream(long size) throws Exception
Exception
protected void negotiateDCAU(FTPClient src, FTPClient dst) throws IOException, FTPException
IOException
FTPException
Copyright © 2016. All rights reserved.