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

public class OgcUrlResourceReader extends Object implements ddf.catalog.resource.ResourceReader
Resource Reader which provide redirection when a product has a mime type of text/html
  • Field Details

  • Constructor Details

    • OgcUrlResourceReader

      public OgcUrlResourceReader(ddf.catalog.resource.ResourceReader urlResourceReader, org.apache.tika.Tika tika)
  • Method Details

    • getSupportedSchemes

      public Set<String> getSupportedSchemes()
      Specified by:
      getSupportedSchemes in interface ddf.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.ResourceNotSupportedException
      Retrieves a 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. The Resource's name gets set to the URI passed in. Calls URLResourceReader, if the mime-type is "text/html" it will inject a simple script to redirect to the resourceURI instead of attempting to download it.
      Specified by:
      retrieveResource in interface ddf.catalog.resource.ResourceReader
      Parameters:
      resourceURI - A URI that defines what Resource to retrieve and how to do it.
      properties - Any additional arguments that should be passed to the ResourceReader.
      Returns:
      A ResourceResponse containing the retrieved Resource.
      Throws:
      ddf.catalog.resource.ResourceNotSupportedException
      IOException
      ddf.catalog.resource.ResourceNotFoundException
    • getVersion

      public String getVersion()
      Specified by:
      getVersion in interface ddf.catalog.util.Describable
      Specified by:
      getVersion in interface org.codice.ddf.platform.services.common.Describable
    • getId

      public String getId()
      Specified by:
      getId in interface ddf.catalog.util.Describable
      Specified by:
      getId in interface org.codice.ddf.platform.services.common.Describable
    • getTitle

      public String getTitle()
      Specified by:
      getTitle in interface ddf.catalog.util.Describable
      Specified by:
      getTitle in interface org.codice.ddf.platform.services.common.Describable
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface ddf.catalog.util.Describable
      Specified by:
      getDescription in interface org.codice.ddf.platform.services.common.Describable
    • getOrganization

      public String getOrganization()
      Specified by:
      getOrganization in interface ddf.catalog.util.Describable
      Specified by:
      getOrganization in interface org.codice.ddf.platform.services.common.Describable
    • getOptions

      public Set<String> getOptions(ddf.catalog.data.Metacard metacard)
      Specified by:
      getOptions in interface ddf.catalog.resource.ResourceReader