Class HttpClientFileSystemBrowser
- java.lang.Object
-
- org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser
-
- org.eclipse.ecf.provider.filetransfer.httpclient5.HttpClientFileSystemBrowser
-
public class HttpClientFileSystemBrowser extends AbstractFileSystemBrowser
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser
AbstractFileSystemBrowser.DirectoryJob, AbstractFileSystemBrowser.RemoteFileSystemRequest
-
-
Field Summary
Fields Modifier and Type Field Description protected static intDEFAULT_CONNECTION_TIMEOUTprotected org.apache.hc.client5.http.classic.methods.HttpHeadheadMethodprotected org.apache.hc.client5.http.impl.classic.CloseableHttpClienthttpClientprotected org.apache.hc.client5.http.protocol.HttpClientContexthttpContextThis is the context used to retain information about the request that theHttpClientgathers during the request.protected org.apache.hc.client5.http.impl.classic.CloseableHttpResponsehttpResponseThis is the response returned byHttpClientwhen it executesheadMethod.protected Stringpasswordprotected Stringusername-
Fields inherited from class org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser
connectContext, directoryOrFile, fileID, job, listener, proxy, remoteFiles
-
-
Constructor Summary
Constructors Constructor Description HttpClientFileSystemBrowser(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient, IFileID directoryOrFileID, IRemoteFileSystemListener listener, URL directoryOrFileURL, IConnectContext connectContext, Proxy proxy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcancel()protected voidcleanUp()protected voidclearProxy()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 IRemoteFileSystemRequestcreateRemoteFileSystemRequest()protected org.apache.hc.client5.http.auth.CredentialsgetFileRequestCredentials()Retrieves the credentials for requesting the file.protected voidrunRequest()Run the actual request.protected voidsetupAuthentication(String urlString)protected voidsetupProxies()protected voidsetupProxy(Proxy proxy)-
Methods inherited from class org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser
createRemoteFileEvent, getException, isCanceled, newUserCancelledException, selectProxyFromProxies, sendBrowseRequest, setCanceled, setException
-
-
-
-
Field Detail
-
DEFAULT_CONNECTION_TIMEOUT
protected static final int DEFAULT_CONNECTION_TIMEOUT
-
username
protected String username
-
password
protected String password
-
httpClient
protected org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient
-
headMethod
protected volatile org.apache.hc.client5.http.classic.methods.HttpHead headMethod
-
httpResponse
protected volatile org.apache.hc.client5.http.impl.classic.CloseableHttpResponse httpResponse
This is the response returned byHttpClientwhen it executesheadMethod.- Since:
- 5.0
-
httpContext
protected volatile org.apache.hc.client5.http.protocol.HttpClientContext httpContext
This is the context used to retain information about the request that theHttpClientgathers during the request.- Since:
- 5.0
-
-
Constructor Detail
-
HttpClientFileSystemBrowser
public HttpClientFileSystemBrowser(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient, IFileID directoryOrFileID, IRemoteFileSystemListener listener, URL directoryOrFileURL, IConnectContext connectContext, Proxy proxy)- Parameters:
httpClient- http clientdirectoryOrFileID- directory or file idlistener- listenerdirectoryOrFileURL- directory or file idconnectContext- connect contextproxy- proxy- Since:
- 5.0
-
-
Method Detail
-
createRemoteFileSystemRequest
protected IRemoteFileSystemRequest createRemoteFileSystemRequest()
- Overrides:
createRemoteFileSystemRequestin classAbstractFileSystemBrowser
-
cancel
protected void cancel()
- Overrides:
cancelin classAbstractFileSystemBrowser
-
setupProxies
protected void setupProxies()
- Overrides:
setupProxiesin classAbstractFileSystemBrowser
-
cleanUp
protected void cleanUp()
- Overrides:
cleanUpin classAbstractFileSystemBrowser
-
runRequest
protected void runRequest() throws ExceptionDescription copied from class:AbstractFileSystemBrowserRun the actual request. This method is called within the job created to actually get the directory or file information.- Specified by:
runRequestin classAbstractFileSystemBrowser- Throws:
Exception- if some problem with making the request or receiving response to the request.
-
getFileRequestCredentials
protected org.apache.hc.client5.http.auth.Credentials getFileRequestCredentials() throws UnsupportedCallbackException, IOExceptionRetrieves the credentials for requesting the file.- Returns:
- the
Credentialsnecessary to retrieve the file - Throws:
UnsupportedCallbackException- if the callback failsIOException- if IO fails- Since:
- 5.0
-
setupAuthentication
protected void setupAuthentication(String urlString) throws UnsupportedCallbackException, IOException
-
setupProxy
protected void setupProxy(Proxy proxy)
- Specified by:
setupProxyin classAbstractFileSystemBrowser
-
clearProxy
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).- Since:
- 5.0
-
-