FileSpecification

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.ms.System.IDisposable, java.io.Closeable

public final class FileSpecification implements System.IDisposable, Closeable

Class representing embedded file.

Constructors

ConstructorDescription
FileSpecification(IPdfPrimitive specification)File specification
FileSpecification(String file)Constructor for FileSpecification
FileSpecification(System.IO.Stream stream, String name)Constructor for file specification.
FileSpecification(InputStream stream, String name)Constructor for file specification.
FileSpecification(String file, String description)Constructor for FileSpecification.
FileSpecification(System.IO.Stream stream, String name, String description)Constructor for FileSpecification.
FileSpecification(InputStream stream, String name, String description)Constructor for FileSpecification.
FileSpecification(String fileName, Annotation annot)Constructor for FileSpecification.
FileSpecification()Create new empty file specification.

Methods

MethodDescription
getEncoding()Gets encoding format.
setEncoding(int value)Sets encoding format.
isIncludeContents()If true, contents of the file will be included in the file specification.
setIncludeContents(boolean value)If true, contents of the file will be included in the file specification.
getEngineDict()Pdf dictionary containing information about the file.
getEngineObj()Internal only
getEncryptedPayload()Gets encrypted payload.
getDescription()Gets text associated with the file specification.
setDescription(String value)Sets text associated with the file specification.
getAFRelationship()Associated file Relationship.
setAFRelationship(AFRelationship value)Associated file Relationship.
getStreamContents()Gets contents of file as stream.
getContentsInternal()Gets contents file.
getContents()Gets contents file.
setContents(InputStream value)Sets contents file.
setContents(byte[] value)Sets contents file.
getParams()Gets file paramteres.
setParams(FileParams value)Sets file paramteres.
getMIMEType()Gets subtype of the embedded file
setMIMEType(String value)Sets MIMEType.
getName()Gets file specification name.
setName(String value)Sets file specification name.
getUnicodeName()Gets file specification unicode name.
setUnicodeName(String value)Sets file specification unicode name.
getFileSystem()Gets name of the file system.
setFileSystem(String value)Sets name of the file system.
getValue(String key)Gets application-specific parameter.
setValue(String key, String value)Sets application-specific parameter.
close()Dispose contents.
dispose()Dispose contents.

FileSpecification(IPdfPrimitive specification)

public FileSpecification(IPdfPrimitive specification)

File specification

Parameters:

ParameterTypeDescription
specificationIPdfPrimitiveIPdfPrimitive object

FileSpecification(String file)

public FileSpecification(String file)

Constructor for FileSpecification

Parameters:

ParameterTypeDescription
filejava.lang.StringFile path.

FileSpecification(System.IO.Stream stream, String name)

public FileSpecification(System.IO.Stream stream, String name)

Constructor for file specification.

Parameters:

ParameterTypeDescription
streamcom.aspose.ms.System.IO.StreamStream containing data file.
namejava.lang.StringFile specification.

FileSpecification(InputStream stream, String name)

public FileSpecification(InputStream stream, String name)

Constructor for file specification.

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamStream containing data file.
namejava.lang.StringFile specification.

FileSpecification(String file, String description)

public FileSpecification(String file, String description)

Constructor for FileSpecification.

Parameters:

ParameterTypeDescription
filejava.lang.StringFile path.
descriptionjava.lang.StringFile description.

FileSpecification(System.IO.Stream stream, String name, String description)

public FileSpecification(System.IO.Stream stream, String name, String description)

Constructor for FileSpecification.

Parameters:

ParameterTypeDescription
streamcom.aspose.ms.System.IO.StreamStream to be used in the document.
namejava.lang.StringA file specification string.
descriptionjava.lang.StringFile description.

FileSpecification(InputStream stream, String name, String description)

public FileSpecification(InputStream stream, String name, String description)

Constructor for FileSpecification.

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamStream to be used in the document.
namejava.lang.StringA file specification string.
descriptionjava.lang.StringFile description.

FileSpecification(String fileName, Annotation annot)

public FileSpecification(String fileName, Annotation annot)

Constructor for FileSpecification.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringString object
annotAnnotationAnnotation object

FileSpecification()

public FileSpecification()

Create new empty file specification.

getEncoding()

public int getEncoding()

Gets encoding format. Possible values: Zip - file is compressed with ZIP, None - file is not compressed.

Returns: int - int value

setEncoding(int value)

public void setEncoding(int value)

Sets encoding format. Possible values: Zip - file is compressed with ZIP, None - file is not compressed.

Parameters:

ParameterTypeDescription
valueintint value

isIncludeContents()

public boolean isIncludeContents()

If true, contents of the file will be included in the file specification.

Returns: boolean - boolean value

setIncludeContents(boolean value)

public void setIncludeContents(boolean value)

If true, contents of the file will be included in the file specification.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getEngineDict()

public IPdfDictionary getEngineDict()

Pdf dictionary containing information about the file. Internal only

Returns: IPdfDictionary - IPdfDictionary object

getEngineObj()

public IPdfObject getEngineObj()

Internal only

Returns: IPdfObject - IPdfObject object

getEncryptedPayload()

public final EncryptedPayload getEncryptedPayload()

Gets encrypted payload.

Returns: EncryptedPayload - EncryptedPayload instance

getDescription()

public String getDescription()

Gets text associated with the file specification.

Returns: java.lang.String - String value

setDescription(String value)

public void setDescription(String value)

Sets text associated with the file specification.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

getAFRelationship()

public final AFRelationship getAFRelationship()

Associated file Relationship.

Returns: AFRelationship - AFRelationship element

setAFRelationship(AFRelationship value)

public final void setAFRelationship(AFRelationship value)

Associated file Relationship.

Parameters:

ParameterTypeDescription
valueAFRelationshipAFRelationship element

getStreamContents()

public InputStream getStreamContents()

Gets contents of file as stream. Contents is not loaded into memory which allows to decrease memory usage. But this stream does not support positioning and Length property. If you need this features please use Contents property instead.

Returns: java.io.InputStream - InputStream object

getContentsInternal()

public System.IO.Stream getContentsInternal()

Gets contents file.

Returns: com.aspose.ms.System.IO.Stream - Stream object

getContents()

public InputStream getContents()

Gets contents file.

Returns: java.io.InputStream - InputStream object

setContents(InputStream value)

public void setContents(InputStream value)

Sets contents file.

Parameters:

ParameterTypeDescription
valuejava.io.InputStreamInputStream object

setContents(byte[] value)

public void setContents(byte[] value)

Sets contents file.

Parameters:

ParameterTypeDescription
valuebyte[]array of bytes

getParams()

public FileParams getParams()

Gets file paramteres.

Returns: FileParams - FileParams object

setParams(FileParams value)

public void setParams(FileParams value)

Sets file paramteres.

Parameters:

ParameterTypeDescription
valueFileParamsFileParams object

getMIMEType()

public String getMIMEType()

Gets subtype of the embedded file

Returns: java.lang.String - string value

setMIMEType(String value)

public void setMIMEType(String value)

Sets MIMEType.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

getName()

public String getName()

Gets file specification name.

Returns: java.lang.String - String value

setName(String value)

public void setName(String value)

Sets file specification name.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

getUnicodeName()

public String getUnicodeName()

Gets file specification unicode name.

Returns: java.lang.String - String value

setUnicodeName(String value)

public void setUnicodeName(String value)

Sets file specification unicode name.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

getFileSystem()

public String getFileSystem()

Gets name of the file system.

Returns: java.lang.String - String value

setFileSystem(String value)

public void setFileSystem(String value)

Sets name of the file system.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

getValue(String key)

public final String getValue(String key)

Gets application-specific parameter.

Parameters:

ParameterTypeDescription
keyjava.lang.StringParameter name.

Returns: java.lang.String - String value - if parameter found; otherwise, null.

setValue(String key, String value)

public final void setValue(String key, String value)

Sets application-specific parameter.

Parameters:

ParameterTypeDescription
keyjava.lang.StringParameter name.
valuejava.lang.StringNew parameter value.

close()

public void close()

Dispose contents.

dispose()

public void dispose()

Dispose contents.

This method is obsolete, use close() instead.