• BlackBerry Dynamics
  • Runtime library for Android applications
  • 12.0.1.79
GDFileSystem Class Reference

Secure store replacements for the file opening methods in the android.content.Context class. More...

Description

This class contains methods to open files in the BlackBerry Dynamics secure store, for reading or writing.

The methods in this class have the same names and prototypes as the file opening methods in the android.content.Context class. This class is intended to facilitate migration of an application to the BlackBerry Dynamics platform.

The methods in this class have the same programming interface as the methods with the same names in the android.content.Context class, with the following exceptions.

  • Not all file creation modes are supported. Only the modes that are supported have MODE_ constants.
  • Paths are based at the root of the secure file system, which is within the application's private data area.

The methods in this class offer the same capabilities as the constructors in the FileInputStream and FileOutputStream classes.

See also
FileInputStream and FileOutputStream
openFileInput and openFileOutput reference documentation in the android.content.Context class reference on the android.com website.

Static Public Member Functions

static FileInputStream openFileInput (String name) throws FileNotFoundException
 Open a file in the secure store, for reading, from a String containing the path. More...
 
static FileOutputStream openFileOutput (String name, int mode) throws FileNotFoundException
 Open a file in the secure store, for writing, from a String containing the path. More...
 
static String getAbsoluteEncryptedPath (String name)
 This function returns the encrypted path for a file or directory within the secure file system. More...
 

Static Public Attributes

static final int MODE_PRIVATE = 0
 Constant for selecting overwrite mode when opening a file for writing. More...
 
static final int MODE_APPEND = 32768
 Constant for selecting append mode when opening a file for writing. More...
 

Member Function Documentation

◆ openFileInput()

static FileInputStream openFileInput ( String  name) throws FileNotFoundException
static

Call this method to open a file in the secure store, for reading.

Parameters
nameString containing the path of the file to open, in the secure file system.
Returns
FileInputStream for the open file.
Exceptions
FileNotFoundException
com.good.gd.error.GDNotAuthorizedErrorif BlackBerry Dynamics authorization processing has not yet completed.

◆ openFileOutput()

static FileOutputStream openFileOutput ( String  name,
int  mode 
) throws FileNotFoundException
static

Call this method to open a file in the secure store, for writing. If a file already exists at the specified path, the file can either be appended to, or overwritten.

Parameters
nameString containing the path of the file to open, in the secure file system.
modeSelects the action to take if a file already exists at the specified path in the secure file system: MODE_APPEND to append, or just MODE_PRIVATE to truncate.
Returns
FileOutputStream for the open file.
Exceptions
FileNotFoundException
com.good.gd.error.GDNotAuthorizedErrorif BlackBerry Dynamics authorization processing has not yet completed.

◆ getAbsoluteEncryptedPath()

static String getAbsoluteEncryptedPath ( String  name)
static

The principal usage for this function is to provide a path that is compatible with the SQL ATTACH command.

Parameters
nameString containing the path within the secure store.
Returns
String containing the absolute path of the encrypted file in the native file system.

Member Data Documentation

◆ MODE_PRIVATE

final int MODE_PRIVATE = 0
static

This value can be passed as the mode parameter of a openFileOutput call.

◆ MODE_APPEND

final int MODE_APPEND = 32768
static

This value can be passed as the mode parameter of a openFileOutput call.