@Immutable public class HttpDriver extends FsDriver
Subclasses must be thread-safe and should be immutable!
newClient()
Constructor and Description |
---|
HttpDriver(IOPoolProvider provider) |
Modifier and Type | Method and Description |
---|---|
protected org.apache.http.HttpResponse |
executeGet(HttpEntry entry)
Executes the GET request method for the given URI.
|
protected org.apache.http.HttpResponse |
executeHead(HttpEntry entry)
Executes the HEAD request method for the given URI.
|
protected org.apache.http.client.HttpClient |
getClient()
Returns the cached http client obtained by calling
newClient() . |
protected org.apache.http.client.HttpClient |
newClient()
Returns a new http client.
|
FsController<?> |
newController(FsModel model,
FsController<?> parent)
Returns a new thread-safe file system controller for the mount point of
the given file system model and nullable parent file system controller.
|
getPriority, isFederated, newController, toString
public HttpDriver(IOPoolProvider provider)
protected org.apache.http.HttpResponse executeGet(HttpEntry entry) throws IOException
getClient().execute(entry.newGet())
.IOException
protected org.apache.http.HttpResponse executeHead(HttpEntry entry) throws IOException
getClient().execute(entry.newHead())
.IOException
protected final org.apache.http.client.HttpClient getClient()
newClient()
.newClient()
.protected org.apache.http.client.HttpClient newClient()
The implementation in the class HttpDriver
simply returns
new DefaultHttpClient(new ThreadSafeClientConnManager())
.
If you need special configuration, e.g. for authentication or caching,
then you should override this method.
public FsController<?> newController(FsModel model, @CheckForNull FsController<?> parent)
FsDriver
When called, you may assert the following precondition:
assert null == parent
? null == model.getParent()
: parent.getModel().equals(model.getParent())
newController
in class FsDriver
model
- the file system model.parent
- the nullable parent file system controller.FsCompositeDriver.newController(de.schlichtherle.truezip.fs.FsManager, de.schlichtherle.truezip.fs.FsModel, de.schlichtherle.truezip.fs.FsController<? extends de.schlichtherle.truezip.fs.FsModel>)
Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.