public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer
| Modifier and Type | Field and Description |
|---|---|
protected IFileID |
fileid |
protected static String |
HTTP |
protected static int |
HTTP_PORT |
protected static String |
HTTPS |
protected static int |
HTTPS_PORT |
protected int |
httpVersion |
protected static int |
MAX_RETRY |
protected JREProxyHelper |
proxyHelper |
protected static String[] |
supportedProtocols |
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 |
|---|
HttpClientRetrieveFileTransfer(org.apache.http.impl.client.CloseableHttpClient client) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancel this file transfer.
|
protected void |
clearProxy()
This method will clear out the proxy information (so that if this is
reused for a request without a proxy, it will work correctly).
|
protected void |
connectUsingJob(FileTransferJob cjob) |
protected String |
createConnectJobName() |
protected boolean |
doPause()
Subclass overridable version of
AbstractRetrieveFileTransfer.pause(). |
protected boolean |
doResume()
Subclass overridable version of
AbstractRetrieveFileTransfer.resume(). |
protected void |
fireConnectStartEvent() |
protected void |
fireReceiveResumedEvent() |
protected void |
fireTransferReceiveDataEvent() |
protected void |
fireTransferReceiveDoneEvent() |
protected void |
fireTransferReceivePausedEvent() |
Object |
getAdapter(Class adapter) |
protected int |
getConnectTimeout() |
protected org.apache.http.auth.Credentials |
getFileRequestCredentials() |
protected static String |
getHostFromURL(String url) |
ID |
getID()
Return the ID for this 'identifiable' object.
|
protected static int |
getPortFromURL(String url) |
String |
getRemoteFileName()
Obtains the name of the remote file if possible.
|
int |
getResponseCode() |
protected void |
getResponseHeaderValues() |
protected void |
getResumeResponseHeaderValues() |
protected int |
getSocketReadTimeout() |
protected void |
hardClose() |
protected boolean |
isConnected() |
protected void |
openStreams()
Open incoming and outgoing streams associated with this file transfer.
|
protected FileTransferJob |
prepareConnectJob(FileTransferJob cjob) |
protected void |
resetDoneAndException() |
void |
setConnectContextForAuthentication(IConnectContext connectContext)
Set connect context for authentication upon subsequent
IRetrieveFileTransferContainerAdapter.sendRetrieveRequest(IFileID, IFileTransferListener, Map). |
protected void |
setInputStream(InputStream ins) |
protected void |
setRequestHeaderValues() |
protected void |
setResumeRequestHeaderValues() |
protected void |
setupAuthentication(String urlString) |
protected void |
setupProxies() |
protected void |
setupProxy(Proxy proxy)
Setup ECF proxy.
|
static boolean |
supportsProtocol(String protocolString) |
protected static boolean |
urlUsesHttps(String url) |
protected InputStream |
wrapTransferReadInputStream(InputStream inputStream,
org.eclipse.core.runtime.IProgressMonitor monitor) |
createJobName, createRangeName, fireReceiveStartEvent, getBytesReceived, getException, getFileLength, getFileRangeSpecification, getFinalStatus, getListener, getOptions, getPercentComplete, getRemoteFileURL, getRemoteLastModified, getRetrieveNamespace, getSocketCloseTimeout, handleReceivedData, isCanceled, isDone, isPaused, newUserCancelledException, pause, resume, selectProxyFromProxies, sendRetrieveRequest, sendRetrieveRequest, setCloseOutputStream, setDone, setDoneCanceled, setDoneCanceled, setDoneException, setFileLength, setLastModifiedTime, setOutputStream, setProxy, setupAndScheduleJob, targetHasGzSuffix, toHumanReadableBytesprotected static final int HTTP_PORT
protected static final int HTTPS_PORT
protected static final int MAX_RETRY
protected static final String HTTPS
protected static final String HTTP
protected static final String[] supportedProtocols
protected int httpVersion
protected IFileID fileid
protected JREProxyHelper proxyHelper
public HttpClientRetrieveFileTransfer(org.apache.http.impl.client.CloseableHttpClient client)
public String getRemoteFileName()
IIncomingFileTransfergetRemoteFileName in interface IIncomingFileTransfergetRemoteFileName in class AbstractRetrieveFileTransfernull if no such name can be determined.public void cancel()
IFileTransferIFileTransferEvent being delivered to the
IFileTransferListener indicating that transfer is done (IFileTransfer.isDone()
returns true), and some exception will be made availablecancel in interface IFileTransfercancel in class AbstractRetrieveFileTransferprotected void hardClose()
hardClose in class AbstractRetrieveFileTransferprotected org.apache.http.auth.Credentials getFileRequestCredentials()
throws UnsupportedCallbackException,
IOException
UnsupportedCallbackException - if some problemIOException - if some problemprotected void setupProxies()
setupProxies in class AbstractRetrieveFileTransferprotected void resetDoneAndException()
resetDoneAndException in class AbstractRetrieveFileTransferprotected void setupAuthentication(String urlString) throws UnsupportedCallbackException, IOException
protected void setRequestHeaderValues()
throws InvalidFileRangeSpecificationException
public int getResponseCode()
public ID getID()
IIdentifiablenull.getID in interface IIdentifiablegetID in class AbstractRetrieveFileTransfernull.protected void getResponseHeaderValues()
throws IOException
IOExceptionprotected void setInputStream(InputStream ins)
setInputStream in class AbstractRetrieveFileTransferprotected InputStream wrapTransferReadInputStream(InputStream inputStream, org.eclipse.core.runtime.IProgressMonitor monitor)
wrapTransferReadInputStream in class AbstractRetrieveFileTransferprotected int getSocketReadTimeout()
getSocketReadTimeout in class AbstractRetrieveFileTransferprotected int getConnectTimeout()
protected void openStreams()
throws IncomingFileTransferException
AbstractRetrieveFileTransferremoteFileContents and localFileContent
must be non-null after successful completion of the
implementation of this method.openStreams in class AbstractRetrieveFileTransferIncomingFileTransferException - if some problempublic void setConnectContextForAuthentication(IConnectContext connectContext)
IRetrieveFileTransferContainerAdapterIRetrieveFileTransferContainerAdapter.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 IRetrieveFileTransferContainerAdaptersetConnectContextForAuthentication in class AbstractRetrieveFileTransferconnectContext - 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 static int getPortFromURL(String url)
protected static boolean urlUsesHttps(String url)
public static boolean supportsProtocol(String protocolString)
protected boolean isConnected()
protected boolean doPause()
AbstractRetrieveFileTransferAbstractRetrieveFileTransfer.pause(). Subclasses must provide
an implementation of this method to support IFileTransferPausable
.doPause in class AbstractRetrieveFileTransferfalse otherwise.protected boolean doResume()
AbstractRetrieveFileTransferAbstractRetrieveFileTransfer.resume(). Subclasses must
provide an implementation of this method to support
IFileTransferPausable.doResume in class AbstractRetrieveFileTransferfalse otherwise.protected void setResumeRequestHeaderValues()
throws IOException,
InvalidFileRangeSpecificationException
protected void getResumeResponseHeaderValues()
throws IOException
IOExceptionpublic Object getAdapter(Class adapter)
getAdapter in interface org.eclipse.core.runtime.IAdaptablegetAdapter in class AbstractRetrieveFileTransferprotected void setupProxy(Proxy proxy)
AbstractRetrieveFileTransferAbstractRetrieveFileTransfer.sendRetrieveRequest(IFileID, IFileTransferListener, Map) and
AbstractRetrieveFileTransfer.sendRetrieveRequest(IFileID, IFileRangeSpecification, IFileTransferListener, Map)
, prior to the actual call to AbstractRetrieveFileTransfer.openStreams().setupProxy in class AbstractRetrieveFileTransferproxy - the proxy to be setup. Will not be null.protected void clearProxy()
protected void fireConnectStartEvent()
protected String createConnectJobName()
protected FileTransferJob prepareConnectJob(FileTransferJob cjob)
protected void connectUsingJob(FileTransferJob cjob)
protected void fireReceiveResumedEvent()
fireReceiveResumedEvent in class AbstractRetrieveFileTransferprotected void fireTransferReceiveDataEvent()
fireTransferReceiveDataEvent in class AbstractRetrieveFileTransferprotected void fireTransferReceiveDoneEvent()
fireTransferReceiveDoneEvent in class AbstractRetrieveFileTransferprotected void fireTransferReceivePausedEvent()
fireTransferReceivePausedEvent in class AbstractRetrieveFileTransferCopyright © 2004–2020 Eclipse Foundation. All rights reserved.