Package org.eclipse.ecf.provider.filetransfer.httpclient5

# 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 final int`
`DEFAULT_CONNECTION_TIMEOUT`
`protected org.apache.hc.client5.http.classic.methods.HttpHead`
`headMethod`
`protected org.apache.hc.client5.http.impl.classic.CloseableHttpClient`
`httpClient`
`protected org.apache.hc.client5.http.protocol.HttpClientContext`
`httpContext`
This is the context used to retain information about the request that the `HttpClient` gathers during the request.
`protected org.apache.hc.client5.http.impl.classic.CloseableHttpResponse`
`httpResponse`
This is the response returned by `HttpClient` when it executes `headMethod`.
`protected String`
`password`
`protected String`
`username`

### 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

Modifier and Type
Method
Description
`protected void`
`cancel()`
`protected void`
`cleanUp()`
`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 IRemoteFileSystemRequest`
`createRemoteFileSystemRequest()`
`protected org.apache.hc.client5.http.auth.Credentials`
`getFileRequestCredentials()`
Retrieves the credentials for requesting the file.
`protected void`
`runRequest()`
Run the actual request.
`protected void`
`setupAuthentication(String urlString)`
`protected void`
`setupProxies()`
`protected void`
`setupProxy(Proxy proxy)`

### Methods inherited from class org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser

`createRemoteFileEvent, getException, isCanceled, newUserCancelledException, selectProxyFromProxies, sendBrowseRequest, setCanceled, setException`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### 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 by `HttpClient` when it executes `headMethod`.

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 the `HttpClient` gathers during the request.

Since:
  5.0

## Constructor Details

### 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 client
  `directoryOrFileID` - directory or file id
  `listener` - listener
  `directoryOrFileURL` - directory or file id
  `connectContext` - connect context
  `proxy` - proxy
Since:
  5.0

## Method Details

### createRemoteFileSystemRequest

protected IRemoteFileSystemRequest createRemoteFileSystemRequest()

Overrides:
  `createRemoteFileSystemRequest` in class `AbstractFileSystemBrowser`

### cancel

protected void cancel()

Overrides:
  `cancel` in class `AbstractFileSystemBrowser`

### setupProxies

protected void setupProxies()

Overrides:
  `setupProxies` in class `AbstractFileSystemBrowser`

### cleanUp

protected void cleanUp()

Overrides:
  `cleanUp` in class `AbstractFileSystemBrowser`

### runRequest

protected void runRequest() throws Exception
Description copied from class: `AbstractFileSystemBrowser`
Run the actual request. This method is called within the job created to actually get the directory or file information.

Specified by:
  `runRequest` in class `AbstractFileSystemBrowser`
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, IOException
Retrieves the credentials for requesting the file.

Returns:
  the `Credentials` necessary to retrieve the file
Throws:
  `UnsupportedCallbackException` - if the callback fails
  `IOException` - if IO fails
Since:
  5.0

### setupAuthentication

protected void setupAuthentication(String urlString) throws UnsupportedCallbackException, IOException

Throws:
  `UnsupportedCallbackException`
  `IOException`

### setupProxy

protected void setupProxy(Proxy proxy)

Specified by:
  `setupProxy` in class `AbstractFileSystemBrowser`

### 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