private File fileFromResourceMap(ContentValues map) throws IOException { String videoDir = (String) map.get(Resources.DIRECTORY); if (TextUtils.isEmpty(videoDir)) { throw new IOException("Must specify DIRECTORY when inserting Resource"); } String filename = (String) map.get(Resources.FILENAME); if (TextUtils.isEmpty(filename)) { throw new IOException("Must specify FILENAME when inserting Resource"); } // Deprecated if (VizContract.PATH_VIDEO_UNLOCKED.equals(videoDir)) { return VizUtils.getPublicVideoFile(filename); } else if (VizContract.PATH_VIDEO_LOCKED.equals(videoDir)) { return VizUtils.getPrivateVideoFile(filename); } else { // All new files will have a literal path return new File(videoDir, filename); } }