public class DocumentLoader extends Object
RemoteDocuments. Subclass this class to change the
behaviour of loadDocument to suit your purposes.| Modifier and Type | Field and Description |
|---|---|
static String |
DISALLOW_REMOTE_CONTEXT_LOADING
Identifies a system property that can be set to "true" in order to
disallow remote context loading.
|
| Constructor and Description |
|---|
DocumentLoader() |
| Modifier and Type | Method and Description |
|---|---|
DocumentLoader |
addInjectedDoc(String url,
String doc)
Avoid resolving a document by instead using the given serialised
representation.
|
org.apache.http.impl.client.CloseableHttpClient |
getHttpClient()
Get the
CloseableHttpClient which will be used by this
DocumentLoader to resolve HTTP and HTTPS resources. |
RemoteDocument |
loadDocument(String url)
Loads the URL if possible, returning it as a RemoteDocument.
|
void |
setHttpClient(org.apache.http.impl.client.CloseableHttpClient nextHttpClient)
Call this method to override the default CloseableHttpClient provided by
JsonUtils.getDefaultHttpClient.
|
public static final String DISALLOW_REMOTE_CONTEXT_LOADING
public DocumentLoader addInjectedDoc(String url, String doc) throws JsonLdError
url - The URL this document represents.doc - The serialised document as a StringJsonLdError - If loading of the document failed for any reason.public RemoteDocument loadDocument(String url) throws JsonLdError
url - The URL to loadJsonLdError - If there are errors loading or remote context loading has
been disallowed.public org.apache.http.impl.client.CloseableHttpClient getHttpClient()
CloseableHttpClient which will be used by this
DocumentLoader to resolve HTTP and HTTPS resources.CloseableHttpClient which this DocumentLoader uses.public void setHttpClient(org.apache.http.impl.client.CloseableHttpClient nextHttpClient)
nextHttpClient - The CloseableHttpClient to replace the default with.Copyright © 2018. All rights reserved.