Package com.inet.pdfc.config
Class FilePdfSource
- java.lang.Object
-
- com.inet.pdfc.config.PdfSource
-
- com.inet.pdfc.config.FilePdfSource
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<PdfSource>
public class FilePdfSource extends PdfSource
This is aPdfSource
which based on a file system object.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.inet.pdfc.config.PdfSource
KEY_LAST_MODIFIED, KEY_NAME, KEY_PASSWORD, KEY_PATH, KEY_SIZE
-
-
Constructor Summary
Constructors Constructor Description FilePdfSource(java.io.File document)
Creates thePdfSource
for a file system object.FilePdfSource(java.io.File pdfFile, java.lang.String explicitName)
Creates thePdfSource
for a file system object.FilePdfSource(java.io.File pdfFile, java.lang.String explicitName, boolean setNoMetaPath)
Creates thePdfSource
for a file system object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.inet.persistence.RandomAccessRead
getContent()
Returns the readable content of this document sourcelong
getLastModified()
Returns the time of the last modification to the document.java.lang.String
getPath()
Get the path of this document, if one exist.long
getSize()
Returns the size of the raw data in bytes-
Methods inherited from class com.inet.pdfc.config.PdfSource
compareTo, equals, getLanguage, getMetaProperties, getName, getPassword, hashCode, setLanguage, setPageLimit, setPassword
-
-
-
-
Constructor Detail
-
FilePdfSource
public FilePdfSource(java.io.File document)
Creates thePdfSource
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 thePdfSource
for 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:
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 thePdfSource
for 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:
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 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
public java.lang.String getPath()
Get the path of this document, if one exist. If no existing path, it give null back.
-
getContent
public com.inet.persistence.RandomAccessRead getContent() throws java.io.IOException
Returns the readable content of this document source- Specified by:
getContent
in classPdfSource
- 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
-
-