Class OgcUrlResourceReader
java.lang.Object
org.codice.ddf.spatial.ogc.catalog.resource.impl.OgcUrlResourceReader
- All Implemented Interfaces:
ddf.catalog.resource.ResourceReader,ddf.catalog.util.Describable,org.codice.ddf.platform.services.common.Describable
Resource Reader which provide redirection when a product has a mime type of text/html
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOgcUrlResourceReader(ddf.catalog.resource.ResourceReader urlResourceReader, org.apache.tika.Tika tika) -
Method Summary
Modifier and TypeMethodDescriptiongetId()getOptions(ddf.catalog.data.Metacard metacard) getTitle()ddf.catalog.operation.ResourceResponseretrieveResource(URI resourceURI, Map<String, Serializable> properties) Retrieves aResourcebased on aURIand provided arguments.
-
Field Details
-
VERSION
- See Also:
-
SHORTNAME
-
TITLE
- See Also:
-
DESCRIPTION
- See Also:
-
ORGANIZATION
- See Also:
-
-
Constructor Details
-
OgcUrlResourceReader
public OgcUrlResourceReader(ddf.catalog.resource.ResourceReader urlResourceReader, org.apache.tika.Tika tika)
-
-
Method Details
-
getSupportedSchemes
- Specified by:
getSupportedSchemesin interfaceddf.catalog.resource.ResourceReader
-
retrieveResource
public ddf.catalog.operation.ResourceResponse retrieveResource(URI resourceURI, Map<String, Serializable> properties) throws IOException, ddf.catalog.resource.ResourceNotFoundException, ddf.catalog.resource.ResourceNotSupportedExceptionRetrieves aResourcebased on aURIand provided arguments. A connection is made to theURIto obtain theResource'sand build ainvalid reference
InputStreamResourceResponsefrom that. TheResource's name gets set to theURIpassed in. Calls, if the mime-type is "text/html" it will inject a simple script to redirect to the resourceURI instead of attempting to download it.invalid reference
URLResourceReader- Specified by:
retrieveResourcein interfaceddf.catalog.resource.ResourceReader- Parameters:
resourceURI- AURIthat defines whatResourceto retrieve and how to do it.properties- Any additional arguments that should be passed to theResourceReader.- Returns:
- A
ResourceResponsecontaining the retrievedResource. - Throws:
ddf.catalog.resource.ResourceNotSupportedExceptionIOExceptionddf.catalog.resource.ResourceNotFoundException
-
getVersion
- Specified by:
getVersionin interfaceddf.catalog.util.Describable- Specified by:
getVersionin interfaceorg.codice.ddf.platform.services.common.Describable
-
getId
- Specified by:
getIdin interfaceddf.catalog.util.Describable- Specified by:
getIdin interfaceorg.codice.ddf.platform.services.common.Describable
-
getTitle
- Specified by:
getTitlein interfaceddf.catalog.util.Describable- Specified by:
getTitlein interfaceorg.codice.ddf.platform.services.common.Describable
-
getDescription
- Specified by:
getDescriptionin interfaceddf.catalog.util.Describable- Specified by:
getDescriptionin interfaceorg.codice.ddf.platform.services.common.Describable
-
getOrganization
- Specified by:
getOrganizationin interfaceddf.catalog.util.Describable- Specified by:
getOrganizationin interfaceorg.codice.ddf.platform.services.common.Describable
-
getOptions
- Specified by:
getOptionsin interfaceddf.catalog.resource.ResourceReader
-