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 blackberry.io.file.getFileProperties method.


Code Example:
<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>


Supported Platform(s)

- BlackBerry OS 5.0+
- BlackBerry PlayBook 1.0+
- Ripple Emulator
View Supported Platform Table
APIBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
dateCreated       Y Y  Y
dateModified Y Y Y Y Y  Y
directory Y Y Y Y Y  Y
fileExtension Y Y Y Y Y  Y
isHidden Y Y Y Y Y  Y
isReadonly Y Y Y      Y
mimeType Y Y Y      Y
size Y Y 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 IDBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
<feature id="blackberry.io.file" /> Y Y Y Y Y  Y

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

Properties

Date dateCreated
Date dateModified
String directory
String fileExtension
Boolean isHidden
Boolean isReadonly
String mimeType
Number size

Properties

readonly Date dateCreated


File creation date


Supported Platforms
 - BlackBerry PlayBook 1.0+
 - Ripple Emulator

readonly Date dateModified


File modified date


Supported Platforms
 - BlackBerry OS 5.0+
 - BlackBerry PlayBook 1.0+
 - Ripple Emulator

readonly String directory


Provides the directory that the file is in


Supported Platforms
 - BlackBerry OS 5.0+
 - BlackBerry PlayBook 1.0+
 - Ripple Emulator

readonly String fileExtension


Provides the file's extension


Supported Platforms
 - BlackBerry OS 5.0+
 - BlackBerry PlayBook 1.0+
 - Ripple Emulator

readonly Boolean isHidden


Whether or not the file is hidden


Supported Platforms
 - BlackBerry OS 5.0+
 - BlackBerry PlayBook 1.0+
 - Ripple Emulator

readonly Boolean isReadonly


Whether or not the file is read-only


Supported Platforms
 - BlackBerry OS 5.0+
 - Ripple Emulator

readonly String mimeType


Specifies the mime type for the file


Supported Platforms
 - BlackBerry OS 5.0+
 - Ripple Emulator

readonly Number size


File size in bytes


Supported Platforms
 - BlackBerry OS 5.0+
 - BlackBerry PlayBook 1.0+
 - Ripple Emulator

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Dec 30 2012 18:15:37 GMT-0500 (EST)