com.qoppa.pdf.source
Class RAFilePDFSource

java.lang.Object
  extended by com.qoppa.pdf.source.FilePDFSource
      extended by com.qoppa.pdf.source.RAFilePDFSource
All Implemented Interfaces:
PDFSource

public class RAFilePDFSource
extends FilePDFSource

Implementation of the PDFSource interface that uses a RandomAccessFile. This class opens a file using a RandomAccessFile and fulfills the PDFSource interface by passing the calls on to the file.

Author:
Qoppa Software

Constructor Summary
RAFilePDFSource(File source)
          Creates a new RAFilePDFSource instance using the given File.
RAFilePDFSource(File source, boolean lockFile)
          Creates a new RAFilePDFSource instance using the given File and boolean parameter indicating if the file should be locked.
RAFilePDFSource(String fileName)
          Creates a new RAFilePDFSource instance using the given fileName.
RAFilePDFSource(String fileName, boolean lockFile)
          Creates a new RAFilePDFSource instance using the given fileName and boolean parameter indicating if the file should be locked.
 
Method Summary
 PDFContent getContent()
          Returns an object that implements PDFContent, that contains and can deliver the contents of the PDF document.
 
Methods inherited from class com.qoppa.pdf.source.FilePDFSource
equals, getFile, getName, getPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RAFilePDFSource

public RAFilePDFSource(File source)
                throws PDFException
Creates a new RAFilePDFSource instance using the given File.

Parameters:
source - A source file
Throws:
PDFException - If the source file does not exist

RAFilePDFSource

public RAFilePDFSource(String fileName)
                throws PDFException
Creates a new RAFilePDFSource instance using the given fileName.

Parameters:
fileName - A fileName string
Throws:
PDFException - If the File created with fileName does not exist

RAFilePDFSource

public RAFilePDFSource(String fileName,
                       boolean lockFile)
                throws PDFException
Creates a new RAFilePDFSource instance using the given fileName and boolean parameter indicating if the file should be locked. To unlock, use getContent().close().

Parameters:
fileName - A fileName string
lockFile - If true, the internal RandomAccessFile will be locked, otherwise it will not be locked
Throws:
PDFException - If the File created with fileName does not exist
See Also:
PDFContent

RAFilePDFSource

public RAFilePDFSource(File source,
                       boolean lockFile)
                throws PDFException
Creates a new RAFilePDFSource instance using the given File and boolean parameter indicating if the file should be locked. To unlock, use getContent().close().

Parameters:
source - A source file
lockFile - If true, the internal RandomAccessFile will be locked, otherwise it will not be locked
Throws:
PDFException - If the source file does not exist
See Also:
PDFContent
Method Detail

getContent

public PDFContent getContent()
                      throws IOException
Description copied from interface: PDFSource
Returns an object that implements PDFContent, that contains and can deliver the contents of the PDF document.

Specified by:
getContent in interface PDFSource
Overrides:
getContent in class FilePDFSource
Returns:
Returns an object that implements the PDFContent interface.
Throws:
IOException