LocalFileSystem extends FileSystem<LocalResourceId> { @Override protected void delete(Collection<LocalResourceId> resourceIds) throws IOException { for (LocalResourceId resourceId : resourceIds) { try { Files.delete(resourceId.getPath()); } catch (NoSuchFileException e) { LOG.info( "Ignoring failed deletion of file {} which already does not exist.", resourceId, e); } } } LocalFileSystem();   }
@Test public void testDelete() throws Exception { File f1 = temporaryFolder.newFile("file1"); File f2 = temporaryFolder.newFile("file2"); File f3 = temporaryFolder.newFile("other-file"); localFileSystem.delete( toLocalResourceIds(Lists.newArrayList(f1.toPath(), f2.toPath()), false )); assertFalse(f1.exists()); assertFalse(f2.exists()); assertTrue(f3.exists()); }