Class UrlConnectionRetrieveFileTransfer
- java.lang.Object
- 
- org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer
- 
- org.eclipse.ecf.provider.filetransfer.retrieve.UrlConnectionRetrieveFileTransfer
 
 
- 
- All Implemented Interfaces:
- org.eclipse.core.runtime.IAdaptable,- IIdentifiable,- IFileTransfer,- IFileTransferPausable,- IIncomingFileTransfer,- IRetrieveFileTransferContainerAdapter,- IRetrieveFileTransfer
 
 public class UrlConnectionRetrieveFileTransfer extends AbstractRetrieveFileTransfer 
- 
- 
Field SummaryFields Modifier and Type Field Description protected inthttpVersionprotected Stringpasswordprotected intresponseCodeprotected StringresponseMessageprotected URLConnectionurlConnectionprotected Stringusername- 
Fields inherited from class org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransferbuff_length, bytesReceived, CLOSE_TIMEOUT, closeOutputStream, connectContext, DEFAULT_BUF_LENGTH, done, downloadRateBytesPerSecond, exception, fileLength, job, jobLock, lastModifiedTime, listener, localFileContents, options, paused, POLLING_RETRY_ATTEMPTS, proxy, rangeSpecification, READ_TIMEOUT, remoteFileContents, remoteFileID, remoteFileURL, responseHeaders, TIMEOUT_INPUTSTREAM_BUFFER_SIZE, transferStartTime
 
- 
 - 
Constructor SummaryConstructors Constructor Description UrlConnectionRetrieveFileTransfer()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconnect()protected booleandoPause()Subclass overridable version ofAbstractRetrieveFileTransfer.pause().protected booleandoResume()Subclass overridable version ofAbstractRetrieveFileTransfer.resume().<T> TgetAdapter(Class<T> adapter)protected StringgetConnectTimeout()StringgetRemoteFileName()Obtains the name of the remote file if possible.intgetResponseCode()protected voidgetResponseHeaderValues()protected voidgetResumeResponseHeaderValues()protected voidhardClose()protected booleanisConnected()protected voidopenStreams()Open incoming and outgoing streams associated with this file transfer.voidsetConnectContextForAuthentication(IConnectContext connectContext)Set connect context for authentication upon subsequentIRetrieveFileTransferContainerAdapter.sendRetrieveRequest(IFileID, IFileTransferListener, Map).protected voidsetRequestHeaderValues()protected voidsetResumeRequestHeaderValues()protected voidsetupAuthentication()protected voidsetupProxy(Proxy proxy2)Setup ECF proxy.- 
Methods inherited from class org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfercancel, createJobName, createRangeName, fireReceiveResumedEvent, fireReceiveStartEvent, fireTransferReceiveDataEvent, fireTransferReceiveDoneEvent, fireTransferReceivePausedEvent, getBytesReceived, getException, getFileLength, getFileRangeSpecification, getFinalStatus, getID, getListener, getOptions, getPercentComplete, getRemoteFileURL, getRemoteLastModified, getRetrieveNamespace, getSocketCloseTimeout, getSocketReadTimeout, handleReceivedData, isCanceled, isDone, isPaused, newUserCancelledException, pause, resetDoneAndException, resume, selectProxyFromProxies, sendRetrieveRequest, sendRetrieveRequest, setCloseOutputStream, setDone, setDoneCanceled, setDoneCanceled, setDoneException, setFileLength, setInputStream, setLastModifiedTime, setOutputStream, setProxy, setupAndScheduleJob, setupProxies, targetHasGzSuffix, toHumanReadableBytes, wrapTransferReadInputStream
 
- 
 
- 
- 
- 
Field Detail- 
urlConnectionprotected URLConnection urlConnection 
 - 
httpVersionprotected int httpVersion 
 - 
responseCodeprotected int responseCode 
 - 
responseMessageprotected String responseMessage 
 - 
usernameprotected String username 
 - 
passwordprotected String password 
 
- 
 - 
Method Detail- 
getRemoteFileNamepublic String getRemoteFileName() Description copied from interface:IIncomingFileTransferObtains the name of the remote file if possible. The name will typically but not necessarily be the same as the leaf part of the path to the remote file.- Specified by:
- getRemoteFileNamein interface- IIncomingFileTransfer
- Overrides:
- getRemoteFileNamein class- AbstractRetrieveFileTransfer
- Returns:
- The name of the remote file or nullif no such name can be determined.
 
 - 
connectprotected void connect() throws IOException- Throws:
- IOException
 
 - 
isConnectedprotected boolean isConnected() 
 - 
setResumeRequestHeaderValuesprotected void setResumeRequestHeaderValues() throws IOException- Throws:
- IOException
 
 - 
setRequestHeaderValuesprotected void setRequestHeaderValues() throws InvalidFileRangeSpecificationException
 - 
getResponseCodepublic int getResponseCode() 
 - 
getResponseHeaderValuesprotected void getResponseHeaderValues() throws IOException- Throws:
- IOException
 
 - 
getResumeResponseHeaderValuesprotected void getResumeResponseHeaderValues() throws IOException- Throws:
- IOException
 
 - 
setupProxyprotected void setupProxy(Proxy proxy2) Description copied from class:AbstractRetrieveFileTransferSetup ECF proxy. Subclasses must override this method to do appropriate proxy setup. This method will be called from withinAbstractRetrieveFileTransfer.sendRetrieveRequest(IFileID, IFileTransferListener, Map)andAbstractRetrieveFileTransfer.sendRetrieveRequest(IFileID, IFileRangeSpecification, IFileTransferListener, Map), prior to the actual call toAbstractRetrieveFileTransfer.openStreams().- Specified by:
- setupProxyin class- AbstractRetrieveFileTransfer
- Parameters:
- proxy2- the ECF proxy to setup
 
 - 
setupAuthenticationprotected void setupAuthentication() throws IOException, UnsupportedCallbackException
 - 
setConnectContextForAuthenticationpublic void setConnectContextForAuthentication(IConnectContext connectContext) Description copied from interface:IRetrieveFileTransferContainerAdapterSet connect context for authentication upon subsequentIRetrieveFileTransferContainerAdapter.sendRetrieveRequest(IFileID, IFileTransferListener, Map). This method should be called with a non-null connectContext in order to allow authentication to occur during call toIRetrieveFileTransferContainerAdapter.sendRetrieveRequest(IFileID, IFileTransferListener, Map).- Specified by:
- setConnectContextForAuthenticationin interface- IRetrieveFileTransferContainerAdapter
- Overrides:
- setConnectContextForAuthenticationin class- AbstractRetrieveFileTransfer
- Parameters:
- connectContext- the connect context to use for authenticating during subsequent call to- IRetrieveFileTransferContainerAdapter.sendRetrieveRequest(IFileID, IFileTransferListener, Map). If- null, then no authentication will be attempted.
 
 - 
openStreamsprotected void openStreams() throws IncomingFileTransferExceptionDescription copied from class:AbstractRetrieveFileTransferOpen incoming and outgoing streams associated with this file transfer. Subclasses must implement this method to open input and output streams. TheremoteFileContentsandlocalFileContentmust be non-nullafter successful completion of the implementation of this method.- Specified by:
- openStreamsin class- AbstractRetrieveFileTransfer
- Throws:
- IncomingFileTransferException- if some problem
 
 - 
hardCloseprotected void hardClose() - Overrides:
- hardClosein class- AbstractRetrieveFileTransfer
 
 - 
doPauseprotected boolean doPause() Description copied from class:AbstractRetrieveFileTransferSubclass overridable version ofAbstractRetrieveFileTransfer.pause(). Subclasses must provide an implementation of this method to supportIFileTransferPausable.- Specified by:
- doPausein class- AbstractRetrieveFileTransfer
- Returns:
- true if the pause is successful. falseotherwise.
 
 - 
doResumeprotected boolean doResume() Description copied from class:AbstractRetrieveFileTransferSubclass overridable version ofAbstractRetrieveFileTransfer.resume(). Subclasses must provide an implementation of this method to supportIFileTransferPausable.- Specified by:
- doResumein class- AbstractRetrieveFileTransfer
- Returns:
- true if the resume is successful. falseotherwise.
 
 - 
getAdapterpublic <T> T getAdapter(Class<T> adapter) - Specified by:
- getAdapterin interface- org.eclipse.core.runtime.IAdaptable
- Overrides:
- getAdapterin class- AbstractRetrieveFileTransfer
 
 - 
getConnectTimeoutprotected String getConnectTimeout() 
 
- 
 
-