Package com.inet.pdfc.config
Class FilePdfSource
java.lang.Object
com.inet.pdfc.config.PdfSource
com.inet.pdfc.config.FilePdfSource
- All Implemented Interfaces:
Serializable,Comparable<PdfSource>
This is a
PdfSource which based on a file system object.- See Also:
-
Field Summary
Fields inherited from class com.inet.pdfc.config.PdfSource
KEY_LAST_MODIFIED, KEY_NAME, KEY_PASSWORD, KEY_PATH, KEY_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionFilePdfSource(File document) Creates thePdfSourcefor a file system object.FilePdfSource(File pdfFile, String explicitName) Creates thePdfSourcefor a file system object.FilePdfSource(File pdfFile, String explicitName, boolean setNoMetaPath) Creates thePdfSourcefor a file system object. -
Method Summary
Modifier and TypeMethodDescriptioncom.inet.persistence.RandomAccessReadReturns the readable content of this document sourcelongReturns the time of the last modification to the document.getPath()Get the path of this document, if one exist.longgetSize()Returns the size of the raw data in bytesMethods inherited from class com.inet.pdfc.config.PdfSource
compareTo, equals, getLanguage, getMetaProperties, getName, getPassword, hashCode, setLanguage, setPageLimit, setPassword
-
Constructor Details
-
FilePdfSource
Creates thePdfSourcefor a file system object.- Parameters:
document- the actual document file- Throws:
IllegalArgumentException- in case pdfFile cannot be accessed or is a directory- Since:
- 3.0
-
FilePdfSource
Creates thePdfSourcefor a file system object.- Parameters:
pdfFile- the actual PDF document fileexplicitName- the name to be set for thisPdfSource, this replaces the name derived from the file- Throws:
IllegalArgumentException- in case pdfFile cannot be accessed or is a directory- Since:
- 3.0
-
FilePdfSource
Creates thePdfSourcefor a file system object.- Parameters:
pdfFile- the actual PDF document fileexplicitName- the name to be set for thisPdfSource, this replaces the name derived from the filesetNoMetaPath- true for removing path information, for other case false- Throws:
IllegalArgumentException- in case pdfFile cannot be accessed or is a directory- Since:
- 3.0
-
-
Method Details
-
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:
getLastModifiedin classPdfSource- 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 -
getPath
Get the path of this document, if one exist. If no existing path, it give null back. -
getContent
Returns the readable content of this document source- Specified by:
getContentin classPdfSource- Returns:
- the readable content of this document source
- Throws:
IOException- thrown in case the source data cannot be accessed or does not exist
-