Class FilePdfSource

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<PdfSource>

    public class FilePdfSource
    extends PdfSource
    This is a PdfSource which based on a file system object.
    See Also:
    Serialized Form
    • Constructor Detail

      • FilePdfSource

        public FilePdfSource​(java.io.File document)
        Creates the PdfSource for a file system object.
        Parameters:
        document - the actual document file
        Throws:
        java.lang.IllegalArgumentException - in case pdfFile cannot be accessed or is a directory
        Since:
        3.0
      • FilePdfSource

        public FilePdfSource​(java.io.File pdfFile,
                             java.lang.String explicitName)
        Creates the PdfSource for a file system object.
        Parameters:
        pdfFile - the actual PDF document file
        explicitName - the name to be set for this PdfSource, this replaces the name derived from the file
        Throws:
        java.lang.IllegalArgumentException - in case pdfFile cannot be accessed or is a directory
        Since:
        3.0
      • FilePdfSource

        public FilePdfSource​(java.io.File pdfFile,
                             java.lang.String explicitName,
                             boolean setNoMetaPath)
        Creates the PdfSource for a file system object.
        Parameters:
        pdfFile - the actual PDF document file
        explicitName - the name to be set for this PdfSource, this replaces the name derived from the file
        setNoMetaPath - true for removing path information, for other case false
        Throws:
        java.lang.IllegalArgumentException - in case pdfFile cannot be accessed or is a directory
        Since:
        3.0
    • Method Detail

      • getLastModified

        public long getLastModified()
        Returns the time of the last modification to the document. It's only used for report generation an has no impact on the comparison.
        Overrides:
        getLastModified in class PdfSource
        Returns:
        the last modified timestamp of the document; interpreted as milliseconds since the beginning of 1970
      • getSize

        public long getSize()
        Returns the size of the raw data in bytes
        Overrides:
        getSize in class PdfSource
        Returns:
        the size of the raw data in bytes
      • getPath

        public java.lang.String getPath()
        Get the path of this document, if one exist. If no existing path, it give null back.
        Overrides:
        getPath in class PdfSource
        Returns:
        return the path of the document or null if no path exist
      • getContent

        public com.inet.persistence.RandomAccessRead getContent()
                                                         throws java.io.IOException
        Returns the readable content of this document source
        Specified by:
        getContent in class PdfSource
        Returns:
        the readable content of this document source
        Throws:
        java.io.IOException - thrown in case the source data cannot be accessed or does not exist