@Test public void testStrategyExtraParams() throws Exception { final SimplePathStrategy strat = new SimplePathStrategy("authority"); strat.addRoot("tag", mContext.getFilesDir()); File expectedRoot = mContext.getFilesDir().getCanonicalFile(); File file = buildPath(expectedRoot, "file.txt"); assertEquals(file.getPath(), strat.getFileForUri( Uri.parse("content: }
private static File buildPath(File base, String... segments) { File cur = base; for (String segment : segments) { if (segment != null) { cur = new File(cur, segment); } } return cur; }
FileProvider extends ContentProvider { private static File buildPath(File base, String... segments) { File cur = base; for (String segment : segments) { if (segment != null) { cur = new File(cur, segment); } } return cur; } }
FileProvider extends ContentProvider { private static File buildPath(File base, String... segments) { File cur = base; for (String segment : segments) { if (segment != null) { cur = new File(cur, segment); } } return cur; }  }
FileProvider extends ContentProvider { private static File buildPath(File base, String... segments) { File cur = base; for (String segment : segments) { if (segment != null) { cur = new File(cur, segment); } } return cur; }  @Override boolean onCreate(); @Override void attachInfo(@NonNull Context context, @NonNull ProviderInfo info); static Uri getUriForFile(@NonNull Context context, @NonNull String authority,
            @NonNull File file); @Override Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection,
            @Nullable String[] selectionArgs,
            @Nullable String sortOrder); @Override String getType(@NonNull Uri uri); @Override Uri insert(@NonNull Uri uri, ContentValues values); @Override int update(@NonNull Uri uri, ContentValues values, @Nullable String selection,
            @Nullable String[] selectionArgs); @Override int delete(@NonNull Uri uri, @Nullable String selection,
            @Nullable String[] selectionArgs); @Override ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String mode); }
FileProvider extends ContentProvider { private static File buildPath(File base, String... segments) { File cur = base; for (String segment : segments) { if (segment != null) { cur = new File(cur, segment); } } return cur; }  @Override boolean onCreate(); @Override void attachInfo(@NonNull Context context, @NonNull ProviderInfo info); static Uri getUriForFile(@NonNull Context context, @NonNull String authority,
            @NonNull File file); @Override Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection,
            @Nullable String[] selectionArgs,
            @Nullable String sortOrder); @Override String getType(@NonNull Uri uri); @Override Uri insert(@NonNull Uri uri, ContentValues values); @Override int update(@NonNull Uri uri, ContentValues values, @Nullable String selection,
            @Nullable String[] selectionArgs); @Override int delete(@NonNull Uri uri, @Nullable String selection,
            @Nullable String[] selectionArgs); @Override ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String mode);  }