EmbeddedFileCollection

Inheritance: java.lang.Object

All Implemented Interfaces: java.lang.Iterable

public class EmbeddedFileCollection implements Iterable<FileSpecification>

Class representing embedded files collection.

Methods

MethodDescription
isSynchronized()Gets a value indicating whether access to this collection is synchronized (thread safe).
getSyncRoot()Gets an object that can be used to synchronize access to this collection.
size()Gets number of embedded files in collection.
isReadOnly()Determines if collection is read only.
copyTo(FileSpecification[] array, int index)Copies array of FileSpecification object into colleciton.
iterator()Returns colleciton enumerator.
iterator_Rename_Namesake()Returns colleciton enumerator.
isEmbeddedFilesExist()Check is Embedded Files structure exists.
add(FileSpecification file)Adds embedded file specification into collection.
add(String key, FileSpecification file)Adds file to embedded files with the specified key.
deleteByKey(String key)Deletes file from the collection by its key in the collection.
getKeys()Returns list of file attachment keys.
findByName(String name)Returns embedded file by its name.
delete(String name)Delete embedded file by name.
delete()Remove all embedded files from document.
remove(FileSpecification item)Removes specified FileSpecification from collection.
contains(FileSpecification item)Determines if collection contains specified FileSpecification.
clear()Remove all embedded files from document.
get_Item(int index)Gets embedded file by its index.
get_Item(String name)Gets embedded file by its name.

isSynchronized()

public boolean isSynchronized()

Gets a value indicating whether access to this collection is synchronized (thread safe).

Returns: boolean - boolean value

getSyncRoot()

public Object getSyncRoot()

Gets an object that can be used to synchronize access to this collection.

Returns: java.lang.Object - Object for synchronization

size()

public int size()

Gets number of embedded files in collection.

Returns: int - int value

isReadOnly()

public boolean isReadOnly()

Determines if collection is read only. Always returns false.

Returns: boolean - boolean value

copyTo(FileSpecification[] array, int index)

public void copyTo(FileSpecification[] array, int index)

Copies array of FileSpecification object into colleciton.

Parameters:

ParameterTypeDescription
arrayFileSpecification[]Array of objects which will be copied.
indexintStarting index from which copying will be started.

iterator()

public System.Collections.IEnumerator<FileSpecification> iterator()

Returns colleciton enumerator.

Returns: com.aspose.ms.System.Collections.IEnumerator<com.aspose.pdf.FileSpecification> - Enumerator of colleciton.

iterator_Rename_Namesake()

public System.Collections.Generic.IGenericEnumerator<FileSpecification> iterator_Rename_Namesake()

Returns colleciton enumerator.

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerator<com.aspose.pdf.FileSpecification> - Enumerator of colleciton.

isEmbeddedFilesExist()

public boolean isEmbeddedFilesExist()

Check is Embedded Files structure exists. Return TRUE if structure exists, and FALSE if not. If document have never contained embedded files - this structure was not created and absent.

Returns: boolean - boolean value

add(FileSpecification file)

public void add(FileSpecification file)

Adds embedded file specification into collection.

Parameters:

ParameterTypeDescription
fileFileSpecificationFileSpecification which should be added into colleciton.

add(String key, FileSpecification file)

public void add(String key, FileSpecification file)

Adds file to embedded files with the specified key.

Parameters:

ParameterTypeDescription
keyjava.lang.StringKey in the embedded files.
fileFileSpecificationFile specification.

deleteByKey(String key)

public void deleteByKey(String key)

Deletes file from the collection by its key in the collection.

Parameters:

ParameterTypeDescription
keyjava.lang.StringString object Key name.

getKeys()

public final List<String> getKeys()

Returns list of file attachment keys.

Returns: java.util.List<java.lang.String> - List of String values

findByName(String name)

public final FileSpecification findByName(String name)

Returns embedded file by its name.

Parameters:

ParameterTypeDescription
namejava.lang.StringName of the file.

Returns: FileSpecification - FileSpecification instance File specification object if found; otherwise, null.

delete(String name)

public void delete(String name)

Delete embedded file by name.

Parameters:

ParameterTypeDescription
namejava.lang.StringName of the embedded file which should be deleted.

delete()

public void delete()

Remove all embedded files from document.

remove(FileSpecification item)

public boolean remove(FileSpecification item)

Removes specified FileSpecification from collection. Not supported.

Parameters:

ParameterTypeDescription
itemFileSpecificationFileSpecification instance

Returns: boolean - boolean value

contains(FileSpecification item)

public boolean contains(FileSpecification item)

Determines if collection contains specified FileSpecification. Not supported.

Parameters:

ParameterTypeDescription
itemFileSpecificationFileSpecification instance

Returns: boolean - boolean value

clear()

public void clear()

Remove all embedded files from document.

get_Item(int index)

public FileSpecification get_Item(int index)

Gets embedded file by its index.

Parameters:

ParameterTypeDescription
indexintIndex of embedded file. Numbering is started from 1.

Returns: FileSpecification - Retreived embedded file specification

get_Item(String name)

public FileSpecification get_Item(String name)

Gets embedded file by its name.

Parameters:

ParameterTypeDescription
namejava.lang.StringEmbedded file name.

Returns: FileSpecification - Retreived embedded file specification.