Class DirectoryProductSource

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

public class DirectoryProductSource extends Object implements ProductSource
Load a product from a Directory. Usually a directory is created using DirectoryProductOutput. It should contain a product xml file named "product.xml". All other files are treated as attachments.
  • Constructor Details

    • DirectoryProductSource

      public DirectoryProductSource(File directory)
      Construct a new DirectoryProductSource object.
      Parameters:
      directory - the directory containing a product.
  • Method Details

    • streamTo

      public void streamTo(ProductHandler out) throws Exception
      Load Product from a directory, then send product events to the ProductOutput.
      Specified by:
      streamTo in interface ProductSource
      Parameters:
      out - the ProductOutput that will receive the product.
      Throws:
      Exception - if error occurs
    • close

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