getFile


Purpose

Creates or looks up a file.

Signature

DirectoryEntry.getFile(path, options, successCallback, errorCallback)

Returns

This method des not return anything.

Parameters

Name Description Type Use
path Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. DOMstring required
options
  • If create and exclusive flags are both true and the path already exists, the getFile method must fail.

  • If the create flag is true, the path doesn't exist, and no other error occurs, the getFile method must create it as a zero-length file and return a corresponding FileEntry.

  • If the create flag is not true and the path doesn't exist, the getFile method must fail.

  • If the create flag is not true and the path exists, but is a directory, the getFile method must fail.

  • Otherwise, if no other error occurs, the getFile method must return a FileEntry corresponding to path.

Flags optional
successCallback A callback that is called to return the File selected or created. function optional
errorCallback A callback that is called when errors happen. function optional

The Flags type is a simple JavaScript Object with the following strucuture:

{
  boolean create,
  boolean exclusive
}

Related topics

DirectoryEntry
Overview
Legal notice | Copyright © 2015 and Confidential to Pegasystems Inc. All rights reserved. | Feedback
Advanced...