@Test public void testDeleteMedia() throws Exception { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { return; } final File file = configurator.createTestFileMedia(); final long id = configurator.insertToMediaStoreAsMedia(file); try { getMediaManager().deleteMedia(id); assertFalse(file.exists()); } finally { configurator.cleanup(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, file, id); } }
@Override public void deleteMedia(final long id) throws IOException { final String path = getMediaPath(mContentResolver, id); if (!TextUtils.isEmpty(path)) { deleteFile(new File(path)); } }
MediaManagerFile implements MediaManager { @Override public void deleteMedia(final long id) throws IOException { final String path = getMediaPath(mContentResolver, id); if (!TextUtils.isEmpty(path)) { deleteFile(new File(path)); } } }
MediaManagerFile implements MediaManager { @Override public void deleteMedia(final long id) throws IOException { final String path = getMediaPath(mContentResolver, id); if (!TextUtils.isEmpty(path)) { deleteFile(new File(path)); } } MediaManagerFile(@NonNull final ContentResolver contentResolver); }
MediaManagerFile implements MediaManager { @Override public void deleteMedia(final long id) throws IOException { final String path = getMediaPath(mContentResolver, id); if (!TextUtils.isEmpty(path)) { deleteFile(new File(path)); } } MediaManagerFile(@NonNull final ContentResolver contentResolver); @Override void deletePlaylist(final long id); @Override void deleteMedia(final long id); @Override void deleteAlbum(final long id); }
MediaManagerFile implements MediaManager { @Override public void deleteMedia(final long id) throws IOException { final String path = getMediaPath(mContentResolver, id); if (!TextUtils.isEmpty(path)) { deleteFile(new File(path)); } } MediaManagerFile(@NonNull final ContentResolver contentResolver); @Override void deletePlaylist(final long id); @Override void deleteMedia(final long id); @Override void deleteAlbum(final long id);  }