|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ecf.core.sharedobject.AbstractSharedObject
org.eclipse.ecf.provider.filetransfer.AbstractRetrieveFileTransfer
public abstract class AbstractRetrieveFileTransfer
| Field Summary | |
|---|---|
protected int |
buff_length
|
protected long |
bytesReceived
|
static int |
DEFAULT_BUF_LENGTH
|
protected boolean |
done
|
protected java.lang.Exception |
exception
|
protected long |
fileLength
|
protected org.eclipse.core.runtime.jobs.Job |
job
|
protected IFileTransferListener |
listener
|
protected java.io.OutputStream |
localFileContents
|
protected java.io.InputStream |
remoteFileContents
|
protected java.net.URI |
remoteFileReference
|
| Constructor Summary | |
|---|---|
AbstractRetrieveFileTransfer()
|
|
| Method Summary | |
|---|---|
void |
cancel()
Cancel this file transfer. |
protected void |
fireTransferReceiveDataEvent()
|
protected void |
fireTransferReceiveDoneEvent()
|
java.lang.Object |
getAdapter(java.lang.Class adapter)
|
long |
getBytesReceived()
Get number of bytes received so far. |
java.lang.Exception |
getException()
Get any exception associated with this file transfer. |
protected org.eclipse.core.runtime.IStatus |
getFinalStatus(java.lang.Throwable exception)
|
double |
getPercentComplete()
Get the percent complete for this file transfer. |
protected java.net.URI |
getRemoteFileReference()
|
protected void |
hardClose()
|
boolean |
isDone()
Return true if this file transfer is done, false if not yet completed. |
boolean |
isPaused()
|
protected abstract void |
openStreams()
Open incoming and outgoing streams associated with this file transfer. |
boolean |
pause()
Pause file transfer. |
boolean |
resume()
Resume file transfer after having been paused. |
void |
sendRetrieveRequest(java.net.URI remoteFileReference,
IFileTransferListener transferListener)
Send request for transfer of a remote file to local file storage. |
protected void |
setFileLength(long length)
|
protected void |
setInputStream(java.io.InputStream ins)
|
protected void |
setOutputStream(java.io.OutputStream outs)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.ecf.core.identity.IIdentifiable |
|---|
getID |
| Field Detail |
|---|
public static final int DEFAULT_BUF_LENGTH
protected org.eclipse.core.runtime.jobs.Job job
protected java.net.URI remoteFileReference
protected IFileTransferListener listener
protected int buff_length
protected boolean done
protected long bytesReceived
protected java.io.InputStream remoteFileContents
protected java.io.OutputStream localFileContents
protected java.lang.Exception exception
protected long fileLength
| Constructor Detail |
|---|
public AbstractRetrieveFileTransfer()
| Method Detail |
|---|
protected java.net.URI getRemoteFileReference()
protected void setInputStream(java.io.InputStream ins)
protected void setOutputStream(java.io.OutputStream outs)
protected void setFileLength(long length)
protected org.eclipse.core.runtime.IStatus getFinalStatus(java.lang.Throwable exception)
protected void hardClose()
protected void fireTransferReceiveDoneEvent()
protected void fireTransferReceiveDataEvent()
public long getBytesReceived()
IIncomingFileTransfer
getBytesReceived in interface IIncomingFileTransferpublic void cancel()
IFileTransferIFileTransferEvent being
delivered to the IFileTransferListener indicating that transfer
is done (IFileTransfer.isDone() returns true), and some exception will be made
available
cancel in interface IFileTransferpublic java.lang.Exception getException()
IFileTransferIFileTransfer.isDone() method returns true.
If the file transfer completed successfully, IFileTransfer.isDone() will
return true, and this method will return null. If the file transfer
completed unsuccessfully (some exception occurred), then
IFileTransfer.isDone() will return true, and this method will return a
non-null Exception instance that occurred.
getException in interface IFileTransferIFileTransfer.isDone() returns
true.public double getPercentComplete()
IFileTransferIFileTransfer.isDone() method should be consulted to determine if the file
transfer has completed (with or without error).
getPercentComplete in interface IFileTransferpublic boolean isDone()
IFileTransferIFileTransfer.getException() method.
isDone in interface IFileTransferpublic java.lang.Object getAdapter(java.lang.Class adapter)
getAdapter in interface org.eclipse.core.runtime.IAdaptablegetAdapter in class AbstractSharedObject
protected abstract void openStreams()
throws IncomingFileTransferException
IncomingFileTransferException
public void sendRetrieveRequest(java.net.URI remoteFileReference,
IFileTransferListener transferListener)
throws IncomingFileTransferException
IRetrieveFileTransferContainerAdapter
sendRetrieveRequest in interface IRetrieveFileTransferContainerAdapterremoteFileReference - reference to the remote target file (e.g.
http://www.eclipse.org/index.html) or a reference to a
resource that specifies the location of a target file.
Implementing providers will determine what protocol schemes
are supported (e.g. ftp, http, torrent, file, etc) and the
required format of the scheme-specific information. If a
protocol is specified that is not supported, or the
scheme-specific information is not well-formed, then an
IncomingFileTransferException will be thrown. Must not be nulltransferListener - a listener for file transfer events. Must not be null
IncomingFileTransferException - if the provider is not connected or is not in the correct
state for initiating file transferpublic boolean isPaused()
isPaused in interface IFileTransferPausablepublic boolean pause()
IFileTransferPausable
pause in interface IFileTransferPausablepublic boolean resume()
IFileTransferPausable
resume in interface IFileTransferPausable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||