Package com.inet.pdfc.config
Class DirectoryPdfSource
java.lang.Object
com.inet.pdfc.config.DirectoryPdfSource
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 Summary
ConstructorsModifierConstructorDescriptionDirectoryPdfSource
(File directory) Creates the directory source for a file directory.protected
DirectoryPdfSource
(String name) Creates an empty directory source.DirectoryPdfSource
(String name, PdfSource... sources) Creates an artificial directory source -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addPdfSource
(PdfSource source) Adds a PDF source to the directory.getName()
Returns the name of the directory if setgetPdfSource
(String name) Returns a PDF source from the directory.Returns all PDF sources registered to this directorytoString()
-
Constructor Details
-
DirectoryPdfSource
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
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
Creates an artificial directory source- Parameters:
name
- the name of the directorysources
- the PDF source which are contained in this directory, may benull
- Since:
- i-net PDFC 3.0
-
-
Method Details
-
addPdfSource
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 benull
- Since:
- i-net PDFC 3.0
-
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
Returns a PDF source from the directory. May returnnull
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
Returns the name of the directory if set- Returns:
- the name of the directory, may be
null
- Since:
- i-net PDFC 3.0
-
toString
-