Code example for FileNotFoundException

0
        // manually enforce the calling identity. 
        if (Process.myUid() != Binder.getCallingUid()) {
            throw new SecurityException("Permission denied");
        } 
        if (!"r".equals(mode)) {
            throw new FileNotFoundException("Bad mode for " + uri + ": " + mode);
        } 
        String filename = uri.toString().substring(BASE_URI_LEN);
        return ParcelFileDescriptor.open(new File(filename),
            ParcelFileDescriptor.MODE_READ_ONLY);
    } 
     
    @Override 
    public int delete(Uri uri, String selection, String[] selectionArgs) {
        throw new UnsupportedOperationException();
    } 
 
    @Override 
    public Uri insert(Uri uri, ContentValues values) {
        throw new UnsupportedOperationException();
    }