public class HttpClient extends Object implements Closeable, URLConnector
| Modifier and Type | Field and Description |
|---|---|
static SimpleDateFormat |
sdf |
| Constructor and Description |
|---|
HttpClient() |
| Modifier and Type | Method and Description |
|---|---|
void |
addProxyHandler(ProxyHandler proxyHandler) |
void |
addURLConnectionHandler(URLConnectionHandler handler) |
HttpRequest<Object> |
build() |
void |
close() |
InputStream |
connect(URL url)
Connect to the specified URL.
|
TaggedData |
connectTagged(URL url)
Connect to the specified URL, also returning the ETag if available.
|
TaggedData |
connectTagged(URL url,
String tag)
Connect to the specified URL while providing the last known tag for the
remote resource; the response will be
null if the remote resource
is unchanged. |
<T> T |
connectWithProxy(ProxyHandler.ProxySetup proxySetup,
Callable<T> r) |
URLConnectionHandler |
findMatchingHandler(URL url) |
File |
getCacheFileFor(URI url) |
ProxyHandler.ProxySetup |
getProxySetup(URL url) |
Reporter |
getReporter() |
String |
getUserFor(String base) |
boolean |
isOffline() |
URI |
makeDir(URI uri) |
void |
readSettings(Processor processor) |
Object |
send(HttpRequest<?> request) |
TaggedData |
send0(HttpRequest<?> request) |
void |
setCache(File cache) |
void |
setLog(File log) |
void |
setOffline(AtomicBoolean offline) |
void |
setRegistry(Registry registry) |
void |
setReporter(Reporter reporter) |
String |
toName(URI url) |
public static final SimpleDateFormat sdf
public void close()
close in interface Closeableclose in interface AutoCloseablepublic InputStream connect(URL url) throws Exception
URLConnectorconnect in interface URLConnectorIOExceptionExceptionpublic TaggedData connectTagged(URL url) throws Exception
URLConnectorconnectTagged in interface URLConnectorurl - The remote URL.TaggedData; note that the
TaggedData.getTag() method may return
null if the resource has no tag.IOException - @since 1.1Exceptionpublic TaggedData connectTagged(URL url, String tag) throws Exception
URLConnectornull if the remote resource
is unchanged.connectTagged in interface URLConnectorurl - The remote URL.tag - The last known tag value for the resource.TaggedData, or null if the
resource has not modified (i.e., if it has the same tag value).IOException - @since 1.1Exceptionpublic HttpRequest<Object> build()
public Object send(HttpRequest<?> request) throws Exception
Exceptionpublic TaggedData send0(HttpRequest<?> request) throws Exception
Exceptionpublic ProxyHandler.ProxySetup getProxySetup(URL url) throws Exception
Exceptionpublic <T> T connectWithProxy(ProxyHandler.ProxySetup proxySetup, Callable<T> r) throws Exception
Exceptionpublic URLConnectionHandler findMatchingHandler(URL url) throws Exception
Exceptionpublic void setCache(File cache)
public void setReporter(Reporter reporter)
public void setRegistry(Registry registry)
public void addURLConnectionHandler(URLConnectionHandler handler)
public Reporter getReporter()
public void addProxyHandler(ProxyHandler proxyHandler)
public void setLog(File log) throws IOException
IOExceptionpublic String getUserFor(String base) throws MalformedURLException, Exception
MalformedURLExceptionExceptionpublic void readSettings(Processor processor) throws IOException, Exception
IOExceptionExceptionpublic URI makeDir(URI uri) throws URISyntaxException
URISyntaxExceptionpublic boolean isOffline()
public void setOffline(AtomicBoolean offline)
Copyright © 2019 aQute SARL. All rights reserved.