Foxit PDF SDK

Public Member Functions | List of all members
com.foxit.sdk.pdf.PortfolioFolderNode Class Reference
Inheritance diagram for com.foxit.sdk.pdf.PortfolioFolderNode:

## Public Member Functions
| PortfolioFolderNode (PortfolioNode other)
| Constructor, with parent class object. More...
PortfolioFileNode | addFile (String file_path) throws com.foxit.sdk.PDFException
| Add a file (specified by file path) to be a sub node. More...
PortfolioFileNode | addFile (StreamCallback file_stream, String file_name) throws com.foxit.sdk.PDFException
| Add a file (specified with com.foxit.sdk.common.fxcrt.StreamCallback ) to be a sub node. More...
PortfolioFileNode | addPDFDoc (PDFDoc pdf_doc, String file_name) throws com.foxit.sdk.PDFException
| Add an loaded PDF document to be a sub node. More...
PortfolioFolderNode | addSubFolder (String folder_name) throws com.foxit.sdk.PDFException
| Add a new sub folder. More...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
DateTime | getCreationDateTime () throws com.foxit.sdk.PDFException
| Get the creation date time. More...
String | getDescription () throws com.foxit.sdk.PDFException
| Get description. More...
DateTime | getModifiedDateTime () throws com.foxit.sdk.PDFException
| Get the last modified date time. More...
String | getName () throws com.foxit.sdk.PDFException
| Get name of current folder node. More...
PortfolioNodeArray | getSortedSubNodes () throws com.foxit.sdk.PDFException
| Get sub nodes array, which has been sorted according to sorting order and specified field name defined in class Portfolio . More...
boolean | isRoot () throws com.foxit.sdk.PDFException
| Check if current folder node represents root node. More...
void | removeSubNode (PortfolioNode sub_node) throws com.foxit.sdk.PDFException
| Remove a sub node. More...
void | setDescription (String description) throws com.foxit.sdk.PDFException
| Set description. More...
Public Member Functions inherited from com.foxit.sdk.pdf.PortfolioNode
| PortfolioNode (PortfolioNode other)
| Constructor, with another portfolio node object. More...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
int | getNodeType () throws com.foxit.sdk.PDFException
| Get node type. More...
boolean | isEmpty ()
| Check whether current object is empty or not. More...
Public Member Functions inherited from com.foxit.sdk.common.Base
synchronized void | delete ()
| Clean up related C++ resources immediately. More...

## Additional Inherited Members
Static Public Attributes inherited from com.foxit.sdk.pdf.PortfolioNode
static final int | e_TypeFile = 2
| Portfolio node type: file.
static final int | e_TypeFolder = 1
| Portfolio node type: folder.
static final int | e_TypeUnknown = 0
| Unknown portfolio node type.

## Detailed Description

Portfolio folder node is used as a folder, which can contain file and other folder as sub nodes.
Class PortfolioFolderNode is derived from class PortfolioNode . It offers function to access a folder node: add file/folder to folder node, remove sub node from folder node, get all the sub nodes in sorted order, and get/set some properties of folder node.

## Constructor & Destructor Documentation

## ◆ PortfolioFolderNode()

com.foxit.sdk.pdf.PortfolioFolderNode.PortfolioFolderNode | ( | PortfolioNode | other | ) |

Constructor, with parent class object.

Parameters

  [in] | other | Parent class object.

## Member Function Documentation

## ◆ addFile() [1/2]

PortfolioFileNode com.foxit.sdk.pdf.PortfolioFolderNode.addFile | ( | String | file_path | ) | throws com.foxit.sdk.PDFException

Add a file (specified by file path) to be a sub node.

Foxit PDF SDK will retrieve some properties (such as file name, modified date and etc.) from input file path and set them to the file specification object of returned file node. User can also update properties by functions in class FileSpec for the returned file node.

Parameters

  [in] | file_path | A full path of an existing local file.

Returns
  Newly added file node object.

## ◆ addFile() [2/2]

PortfolioFileNode com.foxit.sdk.pdf.PortfolioFolderNode.addFile | ( | StreamCallback | file_stream,
|  | String | file_name
| ) |  | throws com.foxit.sdk.PDFException

Add a file (specified with com.foxit.sdk.common.fxcrt.StreamCallback ) to be a sub node.

Foxit PDF SDK CANNOT retrieve any property from input stream callback. So user should update properties by functions in class FileSpec for returned file node.

Parameters

  [in] | file_stream | A com.foxit.sdk.common.fxcrt.StreamCallback object which is implemented by user to read the file content.
  [in] | file_name | File name for the file specified by stream callback. This name will be used in file specification which is related with the returned file node object.

Returns
  Newly added file node object.

## ◆ addPDFDoc()

PortfolioFileNode com.foxit.sdk.pdf.PortfolioFolderNode.addPDFDoc | ( | PDFDoc | pdf_doc,
|  | String | file_name
| ) |  | throws com.foxit.sdk.PDFException

Add an loaded PDF document to be a sub node.

Foxit PDF SDK will try to retrieve properties (such as creation date and modified date) from input PDF document's metadata and set them to the file specification object of returned file node. User can also update properties by functions in class FileSpec for the returned file node.

Parameters

  [in] | pdf_doc | A valid PDF document object which has been loaded successsfully.
  [in] | file_name | File name for the file specified by stream callback. This name will be used in file specification which is related with the returned file node object.

Returns
  Newly added file node object.

## ◆ addSubFolder()

PortfolioFolderNode com.foxit.sdk.pdf.PortfolioFolderNode.addSubFolder | ( | String | folder_name | ) | throws com.foxit.sdk.PDFException

Add a new sub folder.

Parameters

  [in] | folder_name | Folder name for the new sub folder.

Returns
  Newly added folder node object.

## ◆ delete()

synchronized void com.foxit.sdk.pdf.PortfolioFolderNode.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

## ◆ getCreationDateTime()

DateTime com.foxit.sdk.pdf.PortfolioFolderNode.getCreationDateTime | ( |  | ) | throws com.foxit.sdk.PDFException

Get the creation date time.

Returns
  Creation date time.

## ◆ getDescription()

String com.foxit.sdk.pdf.PortfolioFolderNode.getDescription | ( |  | ) | throws com.foxit.sdk.PDFException

Get description.

Returns
  Description string.

## ◆ getModifiedDateTime()

DateTime com.foxit.sdk.pdf.PortfolioFolderNode.getModifiedDateTime | ( |  | ) | throws com.foxit.sdk.PDFException

Get the last modified date time.

If structure of sub nodes is changed (such as add file/folder, remove sub node), Foxit PDF SDK will update last modified date time of current folder node automatically.

Returns
  Last modified date time.

## ◆ getName()

String com.foxit.sdk.pdf.PortfolioFolderNode.getName | ( |  | ) | throws com.foxit.sdk.PDFException

Get name of current folder node.

Returns
  Name of current folder node. If current folder node is the root node, usually it does not have a name and an empty string will be return for this case.

## ◆ getSortedSubNodes()

PortfolioNodeArray com.foxit.sdk.pdf.PortfolioFolderNode.getSortedSubNodes | ( |  | ) | throws com.foxit.sdk.PDFException

Get sub nodes array, which has been sorted according to sorting order and specified field name defined in class Portfolio .

If the type of values (which are to be compared) is string, Foxit PDF SDK will compare these string values without taking care of whether a character is a capital or a small letter.

Returns
  An array of sorted sub nodes.

## ◆ isRoot()

boolean com.foxit.sdk.pdf.PortfolioFolderNode.isRoot | ( |  | ) | throws com.foxit.sdk.PDFException

Check if current folder node represents root node.

Returns
  true means current folder node is the root node, while false means current folder node is not the root node.

## ◆ removeSubNode()

void com.foxit.sdk.pdf.PortfolioFolderNode.removeSubNode | ( | PortfolioNode | sub_node | ) | throws com.foxit.sdk.PDFException

Remove a sub node.

Parameters

  [in] | sub_node | A node object which represents a sub node of current node to be removed.

Returns
  None.

## ◆ setDescription()

void com.foxit.sdk.pdf.PortfolioFolderNode.setDescription | ( | String | description | ) | throws com.foxit.sdk.PDFException

Set description.

Parameters

  [in] | description | Description string to be set. This can be an empty string.

Returns
  None.