Class ZipProductSource

java.lang.Object
gov.usgs.earthquake.product.io.ZipProductSource
All Implemented Interfaces:
ProductSource

public class ZipProductSource extends Object implements ProductSource
Load a product from an InputStream containing ZIP. ZipProductSource reads an input stream containing a product zip file. This zip file's first entry must be a product xml file containing all product metadata and inline content.
  • Constructor Details

    • ZipProductSource

      public ZipProductSource(File zip)
      Construct a new ZipProductSource.
      Parameters:
      zip - the input stream where zip content is read.
  • Method Details

    • streamTo

      public void streamTo(ProductHandler out) throws Exception
      Parse the zip stream and send product to product output.
      Specified by:
      streamTo in interface ProductSource
      Parameters:
      out - ProductOutput that will receive the product.
      Throws:
      Exception - if error occurs
    • close

      public void close()
      Free any resources associated with this handler.
      Specified by:
      close in interface ProductSource