FileProperties

The FileProperties object provides functions and attributes for interacting with a file's properties on the file system.

This object can only be created by using the getFileProperties method.

Supported Platform(s)

- BlackBerry OS 5.0+
- BlackBerry PlayBook

View Supported Platform Table

APIOS 5.0OS 6.0OS 7.0PlayBookRipple
dateCreated       Y 
dateModified Y Y Y Y 
directory Y Y Y Y 
fileExtension Y Y Y Y 
isHidden Y Y Y Y 
isReadonly Y Y Y   
mimeType Y Y Y   
size Y Y Y Y 

Configuration Document Settings

To use all of the API described for this object, you must ensure the following settings are in your configuration document:


You must declare the feature element(s) below in your configuration document:

Feature IDOS 5.0OS 6.0OS 7.0PlayBookRipple
<feature id="blackberry.io.file" /> Y Y Y Y 

Permission Elements (PlayBook Only)
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.

Properties:


Property Type Description Supported Platform(s)
dateCreated Date
readonly
File creation date
 - BlackBerry PlayBook
dateModified Date
readonly
File modified date
 - BlackBerry OS 5.0+
 - BlackBerry PlayBook
directory String
readonly
Provides the directory that the file is in
 - BlackBerry OS 5.0+
 - BlackBerry PlayBook
fileExtension String
readonly
Provides the file's extension
 - BlackBerry OS 5.0+
 - BlackBerry PlayBook
isHidden Boolean
readonly
Whether or not the file is hidden
 - BlackBerry OS 5.0+
 - BlackBerry PlayBook
isReadonly Boolean
readonly
Whether or not the file is read-only
 - BlackBerry OS 5.0+
mimeType String
readonly
Specifies the mime type for the file
 - BlackBerry OS 5.0+
size Number
readonly
File size in bytes
 - BlackBerry OS 5.0+
 - BlackBerry PlayBook

Code Example(s)


<script type="text/javascript">
  //Example file path only works on BB 5.0 and higher. For PlayBook, you must use the Directory API to resolve the path.
  var filePath = "file:///store/home/user/sample.xml";
       
  if (blackberry.io.file.exists(filePath)) {
    var properties = blackberry.io.file.getFileProperties(filePath);
    if (properties.readonly) {
      alert("file is read only");
    }
  }
</script>

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Dec 30 2012 13:31:17 GMT-0500 (EST)