Class DirectoryPdfSource

java.lang.Object
com.inet.pdfc.config.DirectoryPdfSource

public class DirectoryPdfSource extends Object
This is a simple directory listing interface for the batch comparison. Feel free to override the implementation to serve PDFs from an FTP server or to a implement recursive file search for instance.
Since:
i-net PDFC 3.0
  • Constructor Details

    • DirectoryPdfSource

      protected DirectoryPdfSource(String name)
      Creates an empty directory source. Use this constructor to override the default implementation.
      Parameters:
      name - a name describing this PdfSource, used for the notification messages about missing PDFs in the PdfSorce.
      Since:
      i-net PDFC 3.0
    • DirectoryPdfSource

      public DirectoryPdfSource(File directory)
      Creates the directory source for a file directory. All files not matter their extension which are directly in this directory (not in a sub-directory) will be compared.
      Parameters:
      directory - the directory to get the files from
      Throws:
      IllegalArgumentException - thrown in case the directory is not readable or not a directory
      Since:
      i-net PDFC 3.0
    • DirectoryPdfSource

      public DirectoryPdfSource(String name, PdfSource... sources)
      Creates an artificial directory source
      Parameters:
      name - the name of the directory
      sources - the PDF source which are contained in this directory, may be null
      Since:
      i-net PDFC 3.0
  • Method Details

    • addPdfSource

      protected void addPdfSource(PdfSource source)
      Adds a PDF source to the directory. If a source of the same name already exists, it will be replaced.
      Parameters:
      source - the PDF source to add, must not be null
      Since:
      i-net PDFC 3.0
    • getPdfSources

      public List<PdfSource> getPdfSources()
      Returns all PDF sources registered to this directory
      Returns:
      all PDF sources registered to this directory, never null
      Since:
      i-net PDFC 3.0
    • getPdfSource

      public PdfSource getPdfSource(String name)
      Returns a PDF source from the directory. May return null if the donated resource does not exist in the directory.
      Parameters:
      name - the name of the requested PDF source
      Returns:
      the PDF source where getName().equals( name ) or null if there is no such PDF source registered
      Since:
      i-net PDFC 3.0
    • getName

      public String getName()
      Returns the name of the directory if set
      Returns:
      the name of the directory, may be null
      Since:
      i-net PDFC 3.0
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Since:
      i-net PDFC 3.0