Code example for File

Methods: open

0
			throws FileNotFoundException { 
		if (uri.toString().startsWith(FILE_PROVIDER_PREFIX)) {
			int m = ParcelFileDescriptor.MODE_READ_ONLY;
			if (mode.equalsIgnoreCase("rw"))
				m = ParcelFileDescriptor.MODE_READ_WRITE;
			File f = new File(uri.getPath());
			ParcelFileDescriptor pfd = ParcelFileDescriptor.open(f, m);
			return pfd;
		} else { 
			throw new FileNotFoundException	("Unsupported uri: " + uri.toString());
		} 
	} 
 
	@Override 
	public int update(Uri uri, ContentValues contentvalues, String s, String[] as) {
		// not supported 
		return 0; 
	} 
 
}