public class UrlConnectionRetrieveFileTransfer extends AbstractRetrieveFileTransfer
Modifier and Type | Field and Description |
---|---|
protected int |
httpVersion |
protected String |
password |
protected int |
responseCode |
protected String |
responseMessage |
protected URLConnection |
urlConnection |
protected String |
username |
buff_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 and Description |
---|
UrlConnectionRetrieveFileTransfer() |
Modifier and Type | Method and Description |
---|---|
protected void |
connect() |
protected boolean |
doPause()
Subclass overridable version of
AbstractRetrieveFileTransfer.pause() . |
protected boolean |
doResume()
Subclass overridable version of
AbstractRetrieveFileTransfer.resume() . |
Object |
getAdapter(Class adapter) |
protected String |
getConnectTimeout() |
String |
getRemoteFileName()
Obtains the name of the remote file if possible.
|
int |
getResponseCode() |
protected void |
getResponseHeaderValues() |
protected void |
getResumeResponseHeaderValues() |
protected void |
hardClose() |
protected boolean |
isConnected() |
protected void |
openStreams()
Open incoming and outgoing streams associated with this file transfer.
|
void |
setConnectContextForAuthentication(IConnectContext connectContext)
Set connect context for authentication upon subsequent
IRetrieveFileTransferContainerAdapter.sendRetrieveRequest(IFileID, IFileTransferListener, Map) . |
protected void |
setRequestHeaderValues() |
protected void |
setResumeRequestHeaderValues() |
protected void |
setupAuthentication() |
protected void |
setupProxy(Proxy proxy2)
Setup ECF proxy.
|
cancel, 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
protected URLConnection urlConnection
protected int httpVersion
protected int responseCode
protected String responseMessage
protected String username
protected String password
public String getRemoteFileName()
IIncomingFileTransfer
getRemoteFileName
in interface IIncomingFileTransfer
getRemoteFileName
in class AbstractRetrieveFileTransfer
null
if no such name can be determined.protected void connect() throws IOException
IOException
protected boolean isConnected()
protected void setResumeRequestHeaderValues() throws IOException
IOException
protected void setRequestHeaderValues() throws InvalidFileRangeSpecificationException
public int getResponseCode()
protected void getResponseHeaderValues() throws IOException
IOException
protected void getResumeResponseHeaderValues() throws IOException
IOException
protected void setupProxy(Proxy proxy2)
AbstractRetrieveFileTransfer
AbstractRetrieveFileTransfer.sendRetrieveRequest(IFileID, IFileTransferListener, Map)
and
AbstractRetrieveFileTransfer.sendRetrieveRequest(IFileID, IFileRangeSpecification, IFileTransferListener, Map)
, prior to the actual call to AbstractRetrieveFileTransfer.openStreams()
.setupProxy
in class AbstractRetrieveFileTransfer
proxy2
- the ECF proxy to setupprotected void setupAuthentication() throws IOException, UnsupportedCallbackException
public void setConnectContextForAuthentication(IConnectContext connectContext)
IRetrieveFileTransferContainerAdapter
IRetrieveFileTransferContainerAdapter.sendRetrieveRequest(IFileID, IFileTransferListener, Map)
. This
method should be called with a non-null connectContext in order to allow
authentication to occur during call to
IRetrieveFileTransferContainerAdapter.sendRetrieveRequest(IFileID, IFileTransferListener, Map)
.setConnectContextForAuthentication
in interface IRetrieveFileTransferContainerAdapter
setConnectContextForAuthentication
in class AbstractRetrieveFileTransfer
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.protected void openStreams() throws IncomingFileTransferException
AbstractRetrieveFileTransfer
remoteFileContents
and localFileContent
must be non-null
after successful completion of the
implementation of this method.openStreams
in class AbstractRetrieveFileTransfer
IncomingFileTransferException
- if some problemprotected void hardClose()
hardClose
in class AbstractRetrieveFileTransfer
protected boolean doPause()
AbstractRetrieveFileTransfer
AbstractRetrieveFileTransfer.pause()
. Subclasses must provide
an implementation of this method to support IFileTransferPausable
.doPause
in class AbstractRetrieveFileTransfer
false
otherwise.protected boolean doResume()
AbstractRetrieveFileTransfer
AbstractRetrieveFileTransfer.resume()
. Subclasses must
provide an implementation of this method to support
IFileTransferPausable
.doResume
in class AbstractRetrieveFileTransfer
false
otherwise.public Object getAdapter(Class adapter)
getAdapter
in interface org.eclipse.core.runtime.IAdaptable
getAdapter
in class AbstractRetrieveFileTransfer
protected String getConnectTimeout()
Copyright © 2004–2020 Eclipse Foundation. All rights reserved.