WebResourceFetcherpublic class WebResourceFetcherImpl extends Object implements WebResourceFetcher
WebResourceFetcher.| Modifier and Type | Field | Description |
|---|---|---|
protected static Proxy |
proxy |
|
protected static String |
userAgent |
| Constructor | Description |
|---|---|
WebResourceFetcherImpl() |
| Modifier and Type | Method | Description |
|---|---|---|
InputStream |
getInputStreamForUrl(String urlString) |
Returns an InputStream for the document at the given URL.
|
static Proxy |
getProxy() |
Returns the proxy that will be used for all requests made by Wikidata
Toolkit.
|
static URLConnection |
getUrlConnection(URL url) |
Opens a basic URL connection for the given URL and performs basic
configurations.
|
static String |
getUserAgent() |
Returns the string that will be used to identify the user agent on all
requests made by Wikidata Toolkit.
|
static boolean |
hasProxy() |
Checks whether a proxy is set.
|
static void |
setProxy(Proxy proxy) |
Sets the proxy that will be used for alle requests made by Wikidata
Toolkit.
|
static void |
setUserAgent(String userAgent) |
Sets the string that will be used to identify the user agent on all
requests made by Wikidata Toolkit.
|
public static Proxy getProxy()
public static void setProxy(Proxy proxy)
proxy - the proxy represented as java objectpublic static boolean hasProxy()
public static String getUserAgent()
public static void setUserAgent(String userAgent)
userAgent - the user agent stringpublic static URLConnection getUrlConnection(URL url) throws IOException
HttpURLConnection.url - the URL to openIOExceptionpublic InputStream getInputStreamForUrl(String urlString) throws IOException
WebResourceFetchergetInputStreamForUrl in interface WebResourceFetcherurlString - the URL of the documentIOException - if the document at the URL could not be opened or the URL was
invalidCopyright © 2014–2017 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage