Methods Summary |
---|
public int | delete(android.net.Uri url, java.lang.String where, java.lang.String[] whereArgs)
throw new UnsupportedOperationException("delete not supported");
|
private android.os.ParcelFileDescriptor | getBlobColumnAsFile(android.net.Uri url, java.lang.String mode, java.lang.String sql)
if (!"r".equals(mode)) {
throw new FileNotFoundException("Mode " + mode + " not supported for " + url);
}
SQLiteDatabase db = mOpenHelper.getReadableDatabase();
return DatabaseUtils.blobFileDescriptorForQuery(db, sql, null);
|
public java.lang.String | getType(android.net.Uri url)
int match = sURLMatcher.match(url);
switch (match) {
case DATA_ID_BLOB:
return "application/octet-stream";
case FILE:
return "application/octet-stream";
default:
throw new IllegalArgumentException("Unknown URL");
}
|
public android.net.Uri | insert(android.net.Uri url, ContentValues initialValues)
throw new UnsupportedOperationException("insert not supported");
|
public boolean | onCreate()
mOpenHelper = new DatabaseHelper(getContext());
try {
OutputStream out = getContext().openFileOutput(DATA_FILE, Context.MODE_PRIVATE);
out.write(TEST_BLOB);
out.close();
} catch (IOException ex) {
ex.printStackTrace();
}
return true;
|
public android.os.ParcelFileDescriptor | openFile(android.net.Uri url, java.lang.String mode)
int match = sURLMatcher.match(url);
switch (match) {
case DATA_ID_BLOB:
String sql = "SELECT _blob FROM data WHERE _id=" + url.getPathSegments().get(1);
return getBlobColumnAsFile(url, mode, sql);
case HUGE:
try {
return ParcelFileDescriptor.fromData(TEST_BLOB, null);
} catch (IOException ex) {
throw new FileNotFoundException("Error reading " + url + ":" + ex.toString());
}
case FILE:
File file = getContext().getFileStreamPath(DATA_FILE);
return ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
default:
throw new FileNotFoundException("No files supported by provider at " + url);
}
|
public android.database.Cursor | query(android.net.Uri url, java.lang.String[] projectionIn, java.lang.String selection, java.lang.String[] selectionArgs, java.lang.String sort)
throw new UnsupportedOperationException("query not supported");
|
public int | update(android.net.Uri url, ContentValues values, java.lang.String where, java.lang.String[] whereArgs)
throw new UnsupportedOperationException("update not supported");
|