@Override public void execute() throws Exception { HerdFileUtils.cleanDirectoryIgnoreException(testFile); } });
/** * Cleans up a local test directory by deleting a test file. * * @throws IOException if fails to create a local test file */ @Test public void testCleanDirectoryIgnoreException() throws IOException { File testFile = createLocalFile(localTempPath.toString(), "SOME_FILE", FILE_SIZE_1_KB); HerdFileUtils.cleanDirectoryIgnoreException(localTempPath.toFile()); assertFalse(testFile.exists()); assertTrue(localTempPath.toFile().exists()); }
HerdFileUtils.cleanDirectoryIgnoreException(targetLocalDirectory);