com.spire.pdf.collections
Class PdfFolder

java.lang.Object
  extended by com.spire.pdf.collections.PdfFolder

public class PdfFolder
extends java.lang.Object

A folder for the purpose of organizing files into a hierarchical structure. The structure is represented by a tree with a single root folder acting as the common ancestor for all other folders and files in the collection.


Constructor Summary
PdfFolder(PdfDictionary dictFolder, PdfAttachmentCollection embeddedFiles)
           
PdfFolder(java.lang.String name, PdfAttachmentCollection embeddedFiles)
           
 
Method Summary
 void addExistFolder(java.lang.String folderPath)
          Add local folder into this folder.
 void addFile(java.lang.String filePath)
          Add a local file into this folder.
 void addFile(java.lang.String fileName, java.io.InputStream stream)
          Add a stream into this folder.
 void clear()
          Clear this folder.
 PdfFolder createSubfolder(java.lang.String folderName)
          reate an subfolder.
 void deleteFile(PdfAttachment file)
          Delete the file in this folder.
 void deleteSubfolder(java.lang.String folderName)
          Delete an subfolder.
 java.util.List<PdfAttachment> getFiles()
           
 java.lang.String getName()
          (Required;ExtensionLevel3)A file name representing the name of the folder.Two sibling folders shall not share the same name following case normalization.
 java.util.List<PdfFolder> getSubfolders()
          Get the subfolders of this folder.
 boolean hasSubfolders()
          Whether has subfolders.
 

Constructor Detail

PdfFolder

public PdfFolder(java.lang.String name,
                 PdfAttachmentCollection embeddedFiles)

PdfFolder

public PdfFolder(PdfDictionary dictFolder,
                 PdfAttachmentCollection embeddedFiles)
Method Detail

getName

public java.lang.String getName()
(Required;ExtensionLevel3)A file name representing the name of the folder.Two sibling folders shall not share the same name following case normalization. Note:Descriptions of file name and case normalization follow this table.

Returns:

addFile

public void addFile(java.lang.String filePath)
Add a local file into this folder.

Parameters:
filePath - The local file path.

addFile

public void addFile(java.lang.String fileName,
                    java.io.InputStream stream)
Add a stream into this folder.

Parameters:
fileName - The file name of the stream.
stream - The stream.

deleteFile

public void deleteFile(PdfAttachment file)
Delete the file in this folder.

Parameters:
file - The file.

getFiles

public java.util.List<PdfAttachment> getFiles()
Returns:
Get the files in this folder.

createSubfolder

public PdfFolder createSubfolder(java.lang.String folderName)
reate an subfolder.

Parameters:
folderName - The subfolder name.
Returns:

deleteSubfolder

public void deleteSubfolder(java.lang.String folderName)
Delete an subfolder.

Parameters:
folderName - The subfolder name.

getSubfolders

public java.util.List<PdfFolder> getSubfolders()
Get the subfolders of this folder.

Returns:
The subfolder list in this folder.

hasSubfolders

public boolean hasSubfolders()
Whether has subfolders.

Returns:
True or False

clear

public void clear()
Clear this folder.


addExistFolder

public void addExistFolder(java.lang.String folderPath)
Add local folder into this folder.

Parameters:
folderPath -