List of usage examples for org.apache.commons.io FileUtils deleteDirectory
public static void deleteDirectory(File directory) throws IOException
From source file:de.dentrassi.pm.testing.FileStorageTest.java
private void clearOldStorage() throws IOException { final File file = getStoreLocation(); if (file.isDirectory()) { System.out.println("Clearing old storage: " + file); FileUtils.deleteDirectory(file); }// w w w. j a v a 2 s .c o m }
From source file:gndata.lib.srv.LocalFileTest.java
@After public void tearDown() throws Exception { if (Files.exists(testFileFolder)) { FileUtils.deleteDirectory(testFileFolder.toFile()); }/* ww w .ja v a2s. co m*/ }
From source file:ml.shifu.shifu.udf.CalculateReasonCodeUDFTest.java
@AfterClass public void tearDown() throws IOException { FileUtils.deleteDirectory(new File("common")); }
From source file:com.redhat.victims.VictimsResultCache.java
/** * Purge the cache. The cache directory is removed and re-recreated. * //from ww w.ja va2 s . c o m * @throws VictimsException */ public void purge() throws VictimsException { try { File cache = new File(location); if (cache.exists()) { FileUtils.deleteDirectory(cache); } create(cache); } catch (IOException e) { throw new VictimsException("Could not purge on disk cache.", e); } }
From source file:eu.freme.bpt.service.FailurePolicyTest.java
@Test public void testDirBestEffort() throws IOException { File dir = createDir();//from w w w. j a va 2 s . co m FailurePolicy policy = FailurePolicy.create(FailurePolicy.Strategy.BEST_EFFORT, dir); assertEquals(FailurePolicy.Strategy.BEST_EFFORT, policy.getStrategy()); assertTrue(policy.check()); assertTrue(dir.exists()); FileUtils.deleteDirectory(dir); }
From source file:com.asakusafw.bulkloader.testutil.UnitTestUtil.java
public static void tearDownAfterClass() throws Exception { FileUtils.deleteDirectory(targetDir); }
From source file:com.twosigma.beaker.core.module.elfinder.impl.localfs.LocalFsVolume.java
@Override public void deleteFolder(FsItem fsi) throws IOException { File file = asFile(fsi);/*ww w . jav a 2s.co m*/ if (file.isDirectory()) { FileUtils.deleteDirectory(file); } }
From source file:ezbake.frack.eventbus.EventBusTest.java
@AfterClass public static void cleanup() throws IOException { File dataDir = new File(BASE_TEMP_DIR); FileUtils.deleteDirectory(dataDir); }
From source file:gov.nih.nci.caintegrator.application.analysis.heatmap.HeatmapSampleAnnotationsFileWriterTest.java
@Test public void testWriteSampleInfoFile() throws IOException { File tempDirectory = new File(System.getProperty("java.io.tmpdir") + File.separator + "heatmapTmp"); tempDirectory.mkdir();/* w w w.jav a 2 s .com*/ HeatmapSampleAnnotationsFileWriter fileWriter = new HeatmapSampleAnnotationsFileWriter(); File sampleInfoFile = fileWriter.writeSampleInfoFile(QueryUtil.retrieveSampleValuesMap(setupQueryResult()), columns, new File(tempDirectory.getAbsolutePath() + File.separator + HeatmapFileTypeEnum.ANNOTATIONS.getFilename()).getAbsolutePath(), null); checkFile(sampleInfoFile); FileUtils.deleteDirectory(tempDirectory); }
From source file:com.aniruddhc.acemusic.player.AsyncTasks.AsyncDeleteTask.java
@Override protected Boolean doInBackground(String... params) { if (mSourceType == FilesFoldersFragment.FOLDER) { try {//from w w w .j a va 2 s.c o m FileUtils.deleteDirectory(mSourceFile); } catch (Exception e) { return false; } } else { try { boolean status = mSourceFile.delete(); if (status == true) { return true; } else { return false; } } catch (Exception e) { return false; } } return true; }