@Override public void delete(Path path, RecursiveDeleteOption... options) throws IOException { MoreFiles.deleteRecursively(path, options); }
@Override public void close() throws IOException { // hadoop creates crc files that must be deleted also, so just delete the whole directory deleteRecursively(tempDir.toPath(), ALLOW_INSECURE); } }
@Override public void close() throws IOException { if (running.compareAndSet(true, false)) { node = null; deleteRecursively(elasticsearchDirectory.toPath(), ALLOW_INSECURE); } }
@AndroidIncompatible // Path (for symlink creation) private static void deleteRecursivelyOrLog(java.nio.file.Path path) { try { deleteRecursively(path); } catch (IOException e) { log.log(WARNING, "Failure cleaning up test directory", e); } } }
@AfterClass(alwaysRun = true) public void tearDown() throws Exception { try (Closer closer = Closer.create()) { closer.register(() -> scheduledExecutor.shutdownNow()); closer.register(() -> deleteRecursively(tempDirectory, ALLOW_INSECURE)); } }
@TearDown public void tearDown() throws IOException { deleteRecursively(temporaryDirectory.toPath(), ALLOW_INSECURE); }
@TearDown public void tearDown() throws IOException { deleteRecursively(temporaryDirectory.toPath(), ALLOW_INSECURE); }
@TearDown public void tearDown() throws IOException { deleteRecursively(temporaryDirectory.toPath(), ALLOW_INSECURE); }
@TearDown public void tearDown() throws IOException { deleteRecursively(temporaryDirectory.toPath(), ALLOW_INSECURE); }
@TearDown public void tearDown() throws IOException { deleteRecursively(temporaryDirectory.toPath(), ALLOW_INSECURE); }
@TearDown public void tearDown() throws IOException { deleteRecursively(temporaryDirectory.toPath(), ALLOW_INSECURE); }
@AfterMethod public void tearDown() throws Exception { executor.shutdown(); deleteRecursively(spillPath.toPath(), ALLOW_INSECURE); }
@TearDown public void tearDown() throws IOException { deleteRecursively(temporary.toPath(), ALLOW_INSECURE); }
@TearDown public void tearDown() throws IOException { deleteRecursively(temporaryDirectory.toPath(), ALLOW_INSECURE); }
@TearDown public void tearDown() throws IOException { deleteRecursively(temporaryDirectory.toPath(), ALLOW_INSECURE); }
@AfterClass(alwaysRun = true) public void cleanup() throws IOException { try { getMetastoreClient().dropDatabase(testDbName); } finally { deleteRecursively(tempDir.toPath(), ALLOW_INSECURE); } }
public void testDeleteRecursively_nonDirectoryFile() throws IOException { try (FileSystem fs = newTestFileSystem(SECURE_DIRECTORY_STREAM)) { Path file = fs.getPath("dir/a"); assertTrue(Files.isRegularFile(file, NOFOLLOW_LINKS)); MoreFiles.deleteRecursively(file); assertFalse(Files.exists(file, NOFOLLOW_LINKS)); Path symlink = fs.getPath("/symlinktodir"); assertTrue(Files.isSymbolicLink(symlink)); Path realSymlinkTarget = symlink.toRealPath(); assertTrue(Files.isDirectory(realSymlinkTarget, NOFOLLOW_LINKS)); MoreFiles.deleteRecursively(symlink); assertFalse(Files.exists(symlink, NOFOLLOW_LINKS)); assertTrue(Files.isDirectory(realSymlinkTarget, NOFOLLOW_LINKS)); } }
public void testDeleteRecursively_symlinkToDir() throws IOException { try (FileSystem fs = newTestFileSystem(SECURE_DIRECTORY_STREAM)) { Path symlink = fs.getPath("/symlinktodir"); Path dir = fs.getPath("dir"); assertEquals(6, MoreFiles.listFiles(dir).size()); MoreFiles.deleteRecursively(symlink); assertFalse(Files.exists(symlink)); assertTrue(Files.exists(dir)); assertEquals(6, MoreFiles.listFiles(dir).size()); } }
public void testDeleteRecursively_symlinkToDir_sdsNotSupported_allowInsecure() throws IOException { try (FileSystem fs = newTestFileSystem()) { Path symlink = fs.getPath("/symlinktodir"); Path dir = fs.getPath("dir"); assertEquals(6, MoreFiles.listFiles(dir).size()); MoreFiles.deleteRecursively(symlink, ALLOW_INSECURE); assertFalse(Files.exists(symlink)); assertTrue(Files.exists(dir)); assertEquals(6, MoreFiles.listFiles(dir).size()); } }
@Override public void close() throws IOException { if (started.get() && !stopped.getAndSet(true)) { kafka.shutdown(); kafka.awaitShutdown(); zookeeper.close(); deleteRecursively(kafkaDataDir.toPath(), ALLOW_INSECURE); } }