Example usage for org.apache.commons.io FileUtils deleteDirectory

List of usage examples for org.apache.commons.io FileUtils deleteDirectory

Introduction

In this page you can find the example usage for org.apache.commons.io FileUtils deleteDirectory.

Prototype

public static void deleteDirectory(File directory) throws IOException 

Source Link

Document

Deletes a directory recursively.

Usage

From source file:de.fhg.iais.commons.stream.OutputStreamTestBase.java

@AfterClass
public static void cleanup() throws IOException {
    FileUtils.deleteDirectory(DIRECTORY);
}

From source file:h2backup.H2BackupTestBase.java

@After
public void baseTearDown() throws IOException {
    if (Files.exists(workDirectory)) {
        FileUtils.deleteDirectory(workDirectory.toFile());
    }//from   www.  jav  a 2 s.c o  m
}

From source file:com.hurence.logisland.service.solr.SolrRule.java

@Override
protected void before() throws Throwable {

    String base = getClass().getResource("/solr/").getPath();

    FileUtils.deleteDirectory(new File(base + "chronix/data"));
    container = new CoreContainer(base);
    container.load();// ww w.ja va 2 s .co  m

    server = new EmbeddedSolrServer(container, "chronix");

    getClient().deleteByQuery("*:*");
    getClient().commit();
}

From source file:com.splunk.shuttl.archiver.bucketlock.BucketLockerTest.java

@AfterMethod
public void tearDown() throws IOException {
    FileUtils.deleteDirectory(tempTestDirectory);
}

From source file:ch.vorburger.exec.ClasspathUnpackerTest.java

@Test
public void testClasspathUnpackerFromFilesystem() throws IOException {
    File toDir = new File("target/testUnpack3");
    FileUtils.deleteDirectory(toDir);
    int c1 = Util.extractFromClasspathToFile("test", toDir);
    Assert.assertEquals(3, c1);/*from   w  ww  .  j  av a 2  s  .c om*/
    Assert.assertTrue(new File(toDir, "a.txt").exists());
    Assert.assertTrue(new File(toDir, "b.txt").exists());
    Assert.assertTrue(new File(toDir, "subdir/c.txt").exists());

    // Now try again - it shouldn't copy anything anymore (optimization)
    int c2 = Util.extractFromClasspathToFile("test", toDir);
    Assert.assertEquals(0, c2);
}

From source file:gov.nih.nci.caintegrator.application.analysis.heatmap.HeatmapJnlpFileWriterTest.java

@Test
public void testWriteSessionFile() throws IOException {
    String urlPrefix = "http://caintegrator2.nci.nih.gov/caintegrator2/heatmap/retrieveFile.jnlp?JSESSIONID=12345&file=";
    String heatmapDirectoryUrl = "http://caintegrator2.nci.nih.gov/caintegrator2/common/";
    File tempDirectory = new File(System.getProperty("java.io.tmpdir") + File.separator + "heatmapTmp");
    tempDirectory.mkdir();//w  w  w. j  av  a  2 s .  com
    HeatmapResult heatmapResult = new HeatmapResult();
    heatmapResult.setGenomicDataFile(TestDataFiles.VALID_FILE);
    heatmapResult.setLayoutFile(TestDataFiles.VALID_FILE);
    heatmapResult.setSampleAnnotationFile(TestDataFiles.VALID_FILE);

    HeatmapJnlpFileWriter.writeJnlpFile(tempDirectory, urlPrefix, heatmapDirectoryUrl, heatmapResult);
    File sessionFile = heatmapResult.getJnlpFile();
    assertTrue(sessionFile.exists());
    checkFile(sessionFile);
    FileUtils.deleteDirectory(tempDirectory);
}

From source file:com.splunk.shuttl.archiver.archive.recovery.IndexPreservingBucketMoverTest.java

@AfterMethod(groups = { "fast-unit" })
public void tearDown() throws IOException {
    FileUtils.deleteDirectory(moveBucketLocation);
}

From source file:com.github.jillesvangurp.persistentcachingmap.PersistentCachingMapTest.java

@AfterMethod
public void afterEach() throws IOException {
    FileUtils.deleteDirectory(dataDir.toFile());
}

From source file:com.kylinolap.job.hadoop.cube.CubeHFileMapper2Test.java

@Before
public void setup() throws Exception {
    this.createTestMetadata();
    // hack for distributed cache
    FileUtils.deleteDirectory(new File("../job/meta"));
    FileUtils.copyDirectory(new File(this.getTestConfig().getMetadataUrl()), new File("../job/meta"));
    CubeDesc desc = CubeManager.getInstance(this.getTestConfig()).getCube(cubeName).getDescriptor();
    codec = new MeasureCodec(desc.getMeasures());
}

From source file:com.shaie.solr.utils.MiniSolrCloudClusterResource.java

@Override
protected void after() {
    try {/*from  w w w .ja va  2  s .c om*/
        solrCluster.close();
        zkServer.close();
        FileUtils.deleteDirectory(workDir);
    } catch (final IOException e) {
        throw new RuntimeException(e);
    }
}