Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.common.filespecification

public Class PDComplexFileSpecification

extends PDFileSpecification
Class Inheritance
Imports
org.apache.pdfbox.cos.COSBase, .COSDictionary, .COSName, .COSStream

This represents a file specification.
Author
Ben Litchfield

Field Summary

Modifier and TypeField and Description
private COSDictionary
private final COSDictionary

Constructor Summary

AccessConstructor and Description
public
PDComplexFileSpecification()

Default Constructor.

public
PDComplexFileSpecification(COSDictionary
The dictionary that fulfils this file specification.
dict
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public COSDictionary

Returns:

The cos object that matches this Java object.
getCOSObject
()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS object.

private COSDictionary
public PDEmbeddedFile

Returns:

The embedded file for this file spec.
getEmbeddedFile
()

Get the embedded file.

public PDEmbeddedFile

Returns:

The embedded dos file for this file spec.
getEmbeddedFileDos
()

Get the embedded dos file.

public PDEmbeddedFile

Returns:

The embedded Mac file for this file spec.
getEmbeddedFileMac
()

Get the embedded Mac file.

public PDEmbeddedFile

Returns:

The embedded unicode file for this file spec.
getEmbeddedFileUnicode
()

Get the embedded unicode file.

public PDEmbeddedFile

Returns:

The embedded file for this file spec.
getEmbeddedFileUnix
()

Get the embedded Unix file.

public String

Returns:

The file name.
getFile
()

Implements abstract org.apache.pdfbox.pdmodel.common.filespecification.PDFileSpecification.getFile.

This will get the file name.

public String

Returns:

The file description.
getFileDescription
()

This will get the description.

public String

Returns:

The file name.
getFileDos
()

This will get the name representing a Dos file.

public String

Returns:

The file name.
getFileMac
()

This will get the name representing a Mac file.

public String

Returns:

The preferred file name.
getFilename
()

Preferred method for getting the filename.

public String

Returns:

The file name.
getFileUnicode
()

This will get the unicode file name.

public String

Returns:

The file name.
getFileUnix
()

This will get the name representing a Unix file.

private COSBase
public boolean

Returns:

True if the file is volatile attribute is set.
isVolatile
()

Get if the file is volatile.

public void
setEmbeddedFile(PDEmbeddedFile
The file to be embedded.
file
)

Set the embedded file for this spec.

public void
setEmbeddedFileUnicode(PDEmbeddedFile
The Unicode file to be embedded.
file
)

Set the embedded Unicode file for this spec.

public void
setFile(String
The name of the file.
file
)

Implements abstract org.apache.pdfbox.pdmodel.common.filespecification.PDFileSpecification.setFile.

This will set the file name.

public void
setFileDescription(String
The file description
description
)

Set the file description.

public void
setFileUnicode(String
The name of the file.
file
)

This will set the unicode file name.

public void
setVolatile(boolean
The new value for the volatility of the file.
fileIsVolatile
)

Tell if the underlying file is volatile and should not be cached by the reader application.

Inherited from org.apache.pdfbox.pdmodel.common.filespecification.PDFileSpecification:
createFS

Field Detail

efDictionaryback to summary
private COSDictionary efDictionary
fsback to summary
private final COSDictionary fs

Constructor Detail

PDComplexFileSpecificationback to summary
public PDComplexFileSpecification()

Default Constructor.

PDComplexFileSpecificationback to summary
public PDComplexFileSpecification(COSDictionary dict)

Constructor. Creates empty COSDictionary if dict is null.

Parameters
dict:COSDictionary

The dictionary that fulfils this file specification.

Method Detail

getCOSObjectback to summary
public COSDictionary getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS object.

Returns:COSDictionary

The cos object that matches this Java object.

Annotations
@Override
getEFDictionaryback to summary
private COSDictionary getEFDictionary()
getEmbeddedFileback to summary
public PDEmbeddedFile getEmbeddedFile()

Get the embedded file.

Returns:PDEmbeddedFile

The embedded file for this file spec.

getEmbeddedFileDosback to summary
public PDEmbeddedFile getEmbeddedFileDos()

Get the embedded dos file.

Returns:PDEmbeddedFile

The embedded dos file for this file spec.

getEmbeddedFileMacback to summary
public PDEmbeddedFile getEmbeddedFileMac()

Get the embedded Mac file.

Returns:PDEmbeddedFile

The embedded Mac file for this file spec.

getEmbeddedFileUnicodeback to summary
public PDEmbeddedFile getEmbeddedFileUnicode()

Get the embedded unicode file.

Returns:PDEmbeddedFile

The embedded unicode file for this file spec.

getEmbeddedFileUnixback to summary
public PDEmbeddedFile getEmbeddedFileUnix()

Get the embedded Unix file.

Returns:PDEmbeddedFile

The embedded file for this file spec.

getFileback to summary
public String getFile()

Implements abstract org.apache.pdfbox.pdmodel.common.filespecification.PDFileSpecification.getFile.

This will get the file name.

Returns:String

The file name.

Annotations
@Override
getFileDescriptionback to summary
public String getFileDescription()

This will get the description.

Returns:String

The file description.

getFileDosback to summary
public String getFileDos()

This will get the name representing a Dos file.

Returns:String

The file name.

getFileMacback to summary
public String getFileMac()

This will get the name representing a Mac file.

Returns:String

The file name.

getFilenameback to summary
public String getFilename()

Preferred method for getting the filename. It will determinate the recommended file name.

First of all we try to get the unicode filename if it exist. If it doesn't exist we take a look at the DOS, MAC UNIX filenames. If no one exist the required F entry will be returned.

Returns:String

The preferred file name.

getFileUnicodeback to summary
public String getFileUnicode()

This will get the unicode file name.

Returns:String

The file name.

getFileUnixback to summary
public String getFileUnix()

This will get the name representing a Unix file.

Returns:String

The file name.

getObjectFromEFDictionaryback to summary
private COSBase getObjectFromEFDictionary(COSName key)
isVolatileback to summary
public boolean isVolatile()

Get if the file is volatile. Default: false

Returns:boolean

True if the file is volatile attribute is set.

setEmbeddedFileback to summary
public void setEmbeddedFile(PDEmbeddedFile file)

Set the embedded file for this spec. You should also call setEmbeddedFileUnicode(PDEmbeddedFile) for cross-platform and cross-language compatibility.

Parameters
file:PDEmbeddedFile

The file to be embedded.

setEmbeddedFileUnicodeback to summary
public void setEmbeddedFileUnicode(PDEmbeddedFile file)

Set the embedded Unicode file for this spec. If you call this, then do not forget to also call setEmbeddedFile(PDEmbeddedFile) or the attachment will not be visible on some viewers.

Parameters
file:PDEmbeddedFile

The Unicode file to be embedded.

setFileback to summary
public void setFile(String file)

Implements abstract org.apache.pdfbox.pdmodel.common.filespecification.PDFileSpecification.setFile.

This will set the file name. You should also call setFileUnicode(String) for cross-platform and cross-language compatibility.

Parameters
file:String

The name of the file.

Annotations
@Override
setFileDescriptionback to summary
public void setFileDescription(String description)

Set the file description.

Parameters
description:String

The file description

setFileUnicodeback to summary
public void setFileUnicode(String file)

This will set the unicode file name. If you call this, then do not forget to also call setFile(String) or the attachment will not be visible on some viewers.

Parameters
file:String

The name of the file.

setVolatileback to summary
public void setVolatile(boolean fileIsVolatile)

Tell if the underlying file is volatile and should not be cached by the reader application. Default: false

Parameters
fileIsVolatile:boolean

The new value for the volatility of the file.