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
Constructor | Description |
---|---|
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
Method | Description |
---|---|
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:
Parameter | Type | Description |
---|---|---|
specification | IPdfPrimitive | IPdfPrimitive object |
FileSpecification(String file)
public FileSpecification(String file)
Constructor for FileSpecification
Parameters:
Parameter | Type | Description |
---|---|---|
file | java.lang.String | File path. |
FileSpecification(System.IO.Stream stream, String name)
public FileSpecification(System.IO.Stream stream, String name)
Constructor for file specification.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | com.aspose.ms.System.IO.Stream | Stream containing data file. |
name | java.lang.String | File specification. |
FileSpecification(InputStream stream, String name)
public FileSpecification(InputStream stream, String name)
Constructor for file specification.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.InputStream | Stream containing data file. |
name | java.lang.String | File specification. |
FileSpecification(String file, String description)
public FileSpecification(String file, String description)
Constructor for FileSpecification.
Parameters:
Parameter | Type | Description |
---|---|---|
file | java.lang.String | File path. |
description | java.lang.String | File description. |
FileSpecification(System.IO.Stream stream, String name, String description)
public FileSpecification(System.IO.Stream stream, String name, String description)
Constructor for FileSpecification.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | com.aspose.ms.System.IO.Stream | Stream to be used in the document. |
name | java.lang.String | A file specification string. |
description | java.lang.String | File description. |
FileSpecification(InputStream stream, String name, String description)
public FileSpecification(InputStream stream, String name, String description)
Constructor for FileSpecification.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.InputStream | Stream to be used in the document. |
name | java.lang.String | A file specification string. |
description | java.lang.String | File description. |
FileSpecification(String fileName, Annotation annot)
public FileSpecification(String fileName, Annotation annot)
Constructor for FileSpecification.
Parameters:
Parameter | Type | Description |
---|---|---|
fileName | java.lang.String | String object |
annot | Annotation | Annotation 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:
Parameter | Type | Description |
---|---|---|
value | int | int 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:
Parameter | Type | Description |
---|---|---|
value | boolean | boolean 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:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | String 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:
Parameter | Type | Description |
---|---|---|
value | AFRelationship | AFRelationship 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:
Parameter | Type | Description |
---|---|---|
value | java.io.InputStream | InputStream object |
setContents(byte[] value)
public void setContents(byte[] value)
Sets contents file.
Parameters:
Parameter | Type | Description |
---|---|---|
value | byte[] | 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:
Parameter | Type | Description |
---|---|---|
value | FileParams | FileParams 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:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | String 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:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | String 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:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | String 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:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | String value |
getValue(String key)
public final String getValue(String key)
Gets application-specific parameter.
Parameters:
Parameter | Type | Description |
---|---|---|
key | java.lang.String | Parameter 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:
Parameter | Type | Description |
---|---|---|
key | java.lang.String | Parameter name. |
value | java.lang.String | New parameter value. |
close()
public void close()
Dispose contents.
dispose()
public void dispose()
Dispose contents.
This method is obsolete, use close() instead.