PDF Clown
0.1.2

org.pdfclown.files
Class File

java.lang.Object
  extended by org.pdfclown.files.File
All Implemented Interfaces:
Closeable

public final class File
extends Object
implements Closeable

PDF file representation.

Since:
0.0.0
Version:
0.1.2, 12/28/12
Author:
Stefano Chizzolini (http://www.stefanochizzolini.it)

Nested Class Summary
static class File.Configuration
          File configuration.
 
Constructor Summary
File()
           
File(IInputStream stream)
           
File(String path)
           
 
Method Summary
 void close()
           
protected  void finalize()
           
 Cloner getCloner()
          Gets the default cloner.
 File.Configuration getConfiguration()
          Gets the file configuration.
 Document getDocument()
          Gets the high-level representation of the file content.
 FileIdentifier getID()
          Gets the identifier of this file.
 IndirectObjects getIndirectObjects()
          Gets the indirect objects collection.
 String getPath()
          Gets the file path.
 Reader getReader()
          Gets the data reader backing this file.
 PdfDictionary getTrailer()
          Gets the file trailer.
 Version getVersion()
          Gets the file header version [PDF:1.6:3.4.1].
 int hashCode()
           
 PdfReference register(PdfDataObject object)
          Registers an internal data object.
 void save()
          Serializes the file to the current file-system path using the standard serialization mode.
 void save(File file, SerializationModeEnum mode)
          Serializes the file to the specified file-system file.
 void save(IOutputStream stream, SerializationModeEnum mode)
          Serializes the file to the specified stream.
 void save(SerializationModeEnum mode)
          Serializes the file to the current file-system path.
 void save(String path, SerializationModeEnum mode)
          Serializes the file to the specified file-system path.
 void setCloner(Cloner value)
           
 void setPath(String value)
           
 void unregister(PdfReference reference)
          Unregisters an internal object.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

File

public File()

File

public File(String path)
     throws FileNotFoundException
Throws:
FileNotFoundException

File

public File(IInputStream stream)
Method Detail

getCloner

public Cloner getCloner()
Gets the default cloner.


getConfiguration

public File.Configuration getConfiguration()
Gets the file configuration.


getDocument

public Document getDocument()
Gets the high-level representation of the file content.


getID

public FileIdentifier getID()
Gets the identifier of this file.


getIndirectObjects

public IndirectObjects getIndirectObjects()
Gets the indirect objects collection.


getPath

public String getPath()
Gets the file path.


getReader

public Reader getReader()
Gets the data reader backing this file.

Returns:
null in case of newly-created file.

getTrailer

public PdfDictionary getTrailer()
Gets the file trailer.


getVersion

public Version getVersion()
Gets the file header version [PDF:1.6:3.4.1].

This property represents just the original file version; to get the actual version, use the Document.getVersion method.


hashCode

public int hashCode()
Overrides:
hashCode in class Object

register

public PdfReference register(PdfDataObject object)
Registers an internal data object.

Since:
0.0.4

save

public void save()
          throws IOException
Serializes the file to the current file-system path using the standard serialization mode.

Throws:
IOException

save

public void save(SerializationModeEnum mode)
          throws IOException
Serializes the file to the current file-system path.

Parameters:
mode - Serialization mode.
Throws:
IOException

save

public void save(String path,
                 SerializationModeEnum mode)
          throws IOException
Serializes the file to the specified file-system path.

Parameters:
path - Target path.
mode - Serialization mode.
Throws:
IOException

save

public void save(File file,
                 SerializationModeEnum mode)
          throws IOException
Serializes the file to the specified file-system file.

Parameters:
file - Target file.
mode - Serialization mode.
Throws:
IOException

save

public void save(IOutputStream stream,
                 SerializationModeEnum mode)
Serializes the file to the specified stream.

It's caller responsibility to close the stream after this method ends.

Parameters:
stream - Target stream.
mode - Serialization mode.

setCloner

public void setCloner(Cloner value)
See Also:
getCloner()

setPath

public void setPath(String value)
See Also:
getPath()

unregister

public void unregister(PdfReference reference)
Unregisters an internal object.

Since:
0.0.5

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

PDF Clown
0.1.2

Project home page

Copyright © 2006-2013 Stefano Chizzolini. Some Rights Reserved.
This documentation is available under the terms of the GNU Free Documentation License.