java.lang.Object | |||
↳ | android.content.Context | ||
↳ | android.content.ContextWrapper | ||
↳ | android.test.RenamingDelegatingContext |
This is a class which delegates to the given context, but performs database and file operations with a renamed database/file name (prefixes default names with a given prefix).
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.content.Context
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns an array of strings naming the private databases associated with
this Context's application package.
| |||||||||||
Delete an existing private SQLiteDatabase associated with this Context's
application package.
| |||||||||||
Delete the given private file associated with this Context's
application package.
| |||||||||||
Returns an array of strings naming the private files associated with
this Context's application package.
| |||||||||||
In order to support calls to getCacheDir(), we create a temp cache dir (inside the real
one) and return it instead.
| |||||||||||
Returns the absolute path on the filesystem where a database created with
openOrCreateDatabase(String, int, SQLiteDatabase.CursorFactory) is stored. | |||||||||||
Returns the absolute path on the filesystem where a file created with
openFileOutput(String, int) is stored. | |||||||||||
Makes accessible all files and databases whose names match the filePrefix that was passed to
the constructor.
| |||||||||||
Open a private file associated with this Context's application package
for reading.
| |||||||||||
Open a private file associated with this Context's application package
for writing.
| |||||||||||
Open a new private SQLiteDatabase associated with this Context's
application package.
| |||||||||||
Open a new private SQLiteDatabase associated with this Context's
application package.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.content.ContextWrapper
| |||||||||||
From class
android.content.Context
| |||||||||||
From class
java.lang.Object
|
context | : the context that will be delagated. |
---|---|
filePrefix | : a prefix with which database and file names will be prefixed. |
context | : the context that will be delagated. |
---|---|
fileContext | : the context that file and db methods will be delgated to |
filePrefix | : a prefix with which database and file names will be prefixed. |
Returns an array of strings naming the private databases associated with this Context's application package.
Delete an existing private SQLiteDatabase associated with this Context's application package.
name | The name (unique in the application package) of the database. |
---|
Delete the given private file associated with this Context's application package.
name | The name of the file to delete; can not contain path separators. |
---|
Returns an array of strings naming the private files associated with this Context's application package.
In order to support calls to getCacheDir(), we create a temp cache dir (inside the real one) and return it instead. This code is basically getCacheDir(), except it uses the real cache dir as the parent directory and creates a test cache dir inside that.
Returns the absolute path on the filesystem where a database created with
openOrCreateDatabase(String, int, SQLiteDatabase.CursorFactory)
is stored.
name | The name of the database for which you would like to get its path. |
---|
Returns the absolute path on the filesystem where a file created with
openFileOutput(String, int)
is stored.
name | The name of the file for which you would like to get its path. |
---|
Makes accessible all files and databases whose names match the filePrefix that was passed to the constructor. Normally only files and databases that were created through this context are accessible.
Open a private file associated with this Context's application package for reading.
name | The name of the file to open; can not contain path separators. |
---|
FileNotFoundException |
---|
Open a private file associated with this Context's application package for writing. Creates the file if it doesn't already exist.
name | The name of the file to open; can not contain path separators. |
---|---|
mode | Operating mode. Use 0 or MODE_PRIVATE for the
default operation, MODE_APPEND to append to an existing file,
MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE to control
permissions. |
FileNotFoundException |
---|
Open a new private SQLiteDatabase associated with this Context's application package. Create the database file if it doesn't exist.
name | The name (unique in the application package) of the database. |
---|---|
mode | Operating mode. Use 0 or MODE_PRIVATE for the
default operation, MODE_WORLD_READABLE
and MODE_WORLD_WRITEABLE to control permissions. |
factory | An optional factory class that is called to instantiate a cursor when query is called. |
Open a new private SQLiteDatabase associated with this Context's application package. Creates the database file if it doesn't exist.
Accepts input param: a concrete instance of DatabaseErrorHandler
to be
used to handle corruption when sqlite reports database corruption.
name | The name (unique in the application package) of the database. |
---|---|
mode | Operating mode. Use 0 or MODE_PRIVATE for the
default operation, MODE_WORLD_READABLE
and MODE_WORLD_WRITEABLE to control permissions. |
factory | An optional factory class that is called to instantiate a cursor when query is called. |
errorHandler | the DatabaseErrorHandler to be used when sqlite reports database
corruption. if null, DefaultDatabaseErrorHandler is assumed. |