Class DirectoryProductSource

  • All Implemented Interfaces:
    ProductSource

    public class DirectoryProductSource
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      DirectoryProductSource​(java.io.File directory)
      Construct a new DirectoryProductSource object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Free any resources associated with this source.
      void streamTo​(ProductHandler out)
      Load Product from a directory, then send product events to the ProductOutput.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DirectoryProductSource

        public DirectoryProductSource​(java.io.File directory)
        Construct a new DirectoryProductSource object.
        Parameters:
        directory - the directory containing a product.
    • Method Detail

      • streamTo

        public void streamTo​(ProductHandler out)
                      throws java.lang.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:
        java.lang.Exception - if error occurs
      • close

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