Class ContentListener

    • Field Detail

      • OUTPUT_DIRECTORY_PROPERTY

        public static final java.lang.String OUTPUT_DIRECTORY_PROPERTY
        configuration property for includePaths - output directory.
        See Also:
        Constant Field Values
      • TEMP_DIRECTORY_PROPERTY

        public static final java.lang.String TEMP_DIRECTORY_PROPERTY
        property for temporary directory
        See Also:
        Constant Field Values
      • OUTPUT_FORMAT_PROPERTY

        public static final java.lang.String OUTPUT_FORMAT_PROPERTY
        property for output format
        See Also:
        Constant Field Values
      • DEFAULT_OUTPUT_FORMAT

        public static final java.lang.String DEFAULT_OUTPUT_FORMAT
        property for default output format
        See Also:
        Constant Field Values
    • Constructor Detail

      • ContentListener

        public ContentListener()
        empty constructor for ContentListener
    • Method Detail

      • configure

        public void configure​(Config config)
                       throws java.lang.Exception
        Description copied from class: AbstractListener
        Read the include and exclude types from config.
        Specified by:
        configure in interface Configurable
        Overrides:
        configure in class DefaultNotificationListener
        Parameters:
        config - the Config object with settings.
        Throws:
        java.lang.Exception - if configuration exceptions occur.
      • onProduct

        public void onProduct​(Product product)
                       throws java.lang.Exception
        Description copied from class: DefaultNotificationListener
        Called by onNotification when a product is retrieved.
        Overrides:
        onProduct in class DefaultNotificationListener
        Parameters:
        product - a product whose notification was accepted.
        Throws:
        java.lang.Exception - if error occurs
      • getOutputPath

        protected java.lang.String getOutputPath​(ProductId id,
                                                 java.lang.String path)
        Generate an output path based on product id and content path.
        Parameters:
        id - the product id.
        path - the content path.
        Returns:
        relative path to write content within output directory.
      • writeContent

        protected void writeContent​(ProductId id,
                                    java.lang.String path,
                                    Content content)
                             throws java.lang.Exception
        Output a product content that was in includePaths.
        Parameters:
        id - the product id.
        path - the content path.
        content - the content.
        Throws:
        java.lang.Exception - when unable to output the content.
      • getOutputDirectory

        public java.io.File getOutputDirectory()
        Returns:
        the outputDirectory
      • setOutputDirectory

        public void setOutputDirectory​(java.io.File outputDirectory)
        Parameters:
        outputDirectory - the outputDirectory to set
      • getTempDirectory

        public java.io.File getTempDirectory()
        Returns:
        the tempDirectory
      • setTempDirectory

        public void setTempDirectory​(java.io.File tempDirectory)
        Parameters:
        tempDirectory - the tempDirectory to set
      • getOutputFormat

        public java.lang.String getOutputFormat()
        Returns:
        the outputFormat
      • setOutputFormat

        public void setOutputFormat​(java.lang.String outputFormat)
        Parameters:
        outputFormat - the outputFormat to set