public class URLResourceReader extends Object implements ResourceReader
| Constructor and Description |
|---|
URLResourceReader()
Default URLResourceReader constructor.
|
URLResourceReader(MimeTypeMapper mimeTypeMapper) |
| Modifier and Type | Method and Description |
|---|---|
String |
getDescription()
Returns a description of the describable item.
|
Boolean |
getFollowRedirects()
Gets the autoRedirect property
|
String |
getId()
Returns the name, aka ID, of the describable item.
|
MimeTypeMapper |
getMimeTypeMapper() |
Set<String> |
getOptions(Metacard metacard)
Obtain a set of all options supported by this ResourceReader.
|
String |
getOrganization()
Returns the organization associated with the describable item.
|
Set<String> |
getRootResourceDirectories() |
Set<String> |
getSupportedSchemes()
Supported schemes are HTTP, HTTPS, and file
|
String |
getTitle()
Returns the title of the describable item.
|
Set<String> |
getURLSupportedSchemes() |
String |
getVersion()
Retrieve the version.
|
protected org.apache.cxf.jaxrs.client.WebClient |
getWebClient(String uri,
Map<String,Serializable> properties) |
ResourceResponse |
retrieveResource(URI resourceURI,
Map<String,Serializable> properties)
|
void |
setFollowRedirects(Boolean redirect)
Specifies whether the code should follow server issued redirection (HTTP Response codes between
300 and 400)
|
void |
setMimeTypeMapper(MimeTypeMapper mimeTypeMapper) |
void |
setRootResourceDirectories(Set<String> rootResourceDirectoryPaths)
Sets the directories that the
URLResourceReader has permission to access when
attempting to download a resource linked by a file URL. |
public URLResourceReader()
public URLResourceReader(MimeTypeMapper mimeTypeMapper)
public String getVersion()
DescribablegetVersion in interface Describablepublic String getId()
Describablehtml for a MetacardTransformer that transforms Metacards to HTMLgetId in interface Describablepublic String getTitle()
DescribablegetTitle in interface Describablepublic String getDescription()
DescribablegetDescription in interface Describablepublic String getOrganization()
DescribablegetOrganization in interface Describablepublic Set<String> getSupportedSchemes()
getSupportedSchemes in interface ResourceReaderpublic MimeTypeMapper getMimeTypeMapper()
public void setMimeTypeMapper(MimeTypeMapper mimeTypeMapper)
public void setRootResourceDirectories(Set<String> rootResourceDirectoryPaths)
URLResourceReader has permission to access when
attempting to download a resource linked by a file URL.rootResourceDirectoryPaths - a set of absolute paths specifying which directories the
URLResourceReader has permission to access when attempting to download resources
linked by a file URL. A null or empty input clears all root resource directory paths from
the URLResourceReader (this effectively blocks all resource downloads linked by
file URLs).public void setFollowRedirects(Boolean redirect)
redirect - true - follow redirections automatically false - do not follow server issued
redirectionspublic Boolean getFollowRedirects()
public ResourceResponse retrieveResource(URI resourceURI, Map<String,Serializable> properties) throws IOException, ResourceNotFoundException
Resource based on a URI and provided
arguments. A connection is made to the URI to obtain the Resource's InputStream and build a ResourceResponse from
that. If the URI's scheme is HTTP or HTTPS, the Resource's
name gets set to the URI passed in, otherwise, if it is a file scheme, the name is set
to the actual file name.retrieveResource in interface ResourceReaderresourceURI - A URI that defines what Resource to
retrieve and how to do it.properties - Any additional arguments that should be passed to the ResourceReader.ResourceResponse containing the retrieved Resource.IOExceptionResourceNotFoundExceptionprotected org.apache.cxf.jaxrs.client.WebClient getWebClient(String uri, Map<String,Serializable> properties)
public Set<String> getOptions(Metacard metacard)
ResourceReaderResource in a unique way.getOptions in interface ResourceReaderSet of all options that this ResourceReader supports. This will be an empty set
if no options are supported.This work is licensed under a Creative Commons Attribution 4.0 International License.