List of usage examples for org.apache.commons.io FileUtils deleteQuietly
public static boolean deleteQuietly(File file)
From source file:net.rhapso.koa.tree.IOTest.java
@After public void tearDown() throws Exception { FileUtils.deleteQuietly(data); }
From source file:com.microsoft.azuretools.hdinsight.util.HDInsightJobViewUtils.java
private static void extractJobViewResource() { URL url = HDInsightJobViewUtils.class.getResource("/resources/" + HTML_ZIP_FILE_NAME); URL hdinsightJobViewJarUrl = HDInsightJobViewUtils.class .getResource("/resources/" + HDINSIGHT_JOB_VIEW_JAR_NAME); if (url == null || hdinsightJobViewJarUrl == null) { DefaultLoader.getUIHelper().showError("Cann't find Spark job view resources", "Job view"); return;//ww w . j a va 2 s .com } File indexRootFile = new File(PluginUtil.pluginFolder, HDINSIGIHT_FOLDER_NAME); if (indexRootFile.exists()) { FileUtils.deleteQuietly(indexRootFile); } File htmlRootFile = new File(indexRootFile.getPath(), "html"); htmlRootFile.mkdirs(); File htmlToFile = new File(htmlRootFile.getAbsolutePath(), HTML_ZIP_FILE_NAME); File hdinsightJobViewToFile = new File(indexRootFile, HDINSIGHT_JOB_VIEW_JAR_NAME); try { FileUtils.copyURLToFile(url, htmlToFile); FileUtils.copyURLToFile(hdinsightJobViewJarUrl, hdinsightJobViewToFile); HDInsightJobViewUtils.unzip(htmlToFile.getAbsolutePath(), htmlToFile.getParent()); DefaultLoader.getIdeHelper().setProperty(HDINSIGHT_JOBVIEW_EXTRACT_FLAG, "true"); } catch (IOException e) { DefaultLoader.getUIHelper().showError("Extract Job View Folder error:" + e.getMessage(), "Job view"); } }
From source file:com.thoughtworks.go.domain.materials.MixedMultipleMaterialsTest.java
@After public void cleanupRepo() { svnRepo.tearDown(); hgRepo.tearDown(); FileUtils.deleteQuietly(pipelineDir); }
From source file:com.splunk.shuttl.archiver.util.UtilsBucketTest.java
@Test(expectedExceptions = { IllegalArgumentException.class }) public void getCsvFile_emptyBucket_throwsException() { Bucket emptyBucket = TUtilsBucket.createBucket(); FileUtils.deleteQuietly(emptyBucket.getDirectory()); assertTrue(emptyBucket.getDirectory().mkdirs()); UtilsBucket.getCsvFile(emptyBucket); }
From source file:com.googlecode.t7mp.CommonsSetupUtilTest.java
@After public void tearDown() throws IOException { FileUtils.deleteDirectory(catalinaBaseDir); if (catalinaBaseDir.exists()) { System.err.println("Could not delete directory " + catalinaBaseDir.getAbsolutePath()); }//from w ww . java2s .c om FileUtils.deleteQuietly(source); FileUtils.deleteQuietly(target); }
From source file:com.thoughtworks.go.domain.materials.perforce.PerforceFixture.java
@After public void stopP4Server() { p4Fixture.stop(p4); FileUtils.deleteQuietly(clientFolder); }
From source file:com.thoughtworks.go.utils.TestRepoFixture.java
public void destroy() { FileUtils.deleteQuietly(testRepo); }
From source file:io.github.robwin.swagger2markup.Swagger2MarkupConverterTest.java
@Test public void testSwagger2AsciiDocConversionWithDescriptionsAndExamples() throws IOException { //Given/*from ww w . ja v a 2s. c om*/ File file = new File(Swagger2MarkupConverterTest.class.getResource("/json/swagger.json").getFile()); File outputDirectory = new File("build/docs/asciidoc/generated"); FileUtils.deleteQuietly(outputDirectory); //When Swagger2MarkupConverter.from(file.getAbsolutePath()).withDescriptions("src/docs/asciidoc") .withExamples("src/docs/asciidoc/paths").build().intoFolder(outputDirectory.getAbsolutePath()); //Then String[] directories = outputDirectory.list(); assertThat(directories).hasSize(3).containsAll(asList("definitions.adoc", "overview.adoc", "paths.adoc")); }
From source file:de.hybris.platform.commons.jalo.FOPFormatterTest.java
@Test public void testFormat() throws Exception { File tempfile = null;/*from w w w .j a v a2 s . c om*/ try { tempfile = formatter.transform(sampleFile.getInputStream(), sampleFile.getInputStream()); Assert.assertTrue("Should be correctly recognized as a pdf file ", formatter.validate(tempfile)); } finally { FileUtils.deleteQuietly(tempfile); } }
From source file:com.splunk.shuttl.archiver.bucketsize.BucketSizeIOTest.java
@AfterMethod public void tearDown() { FileUtils.deleteQuietly(tempDir); }