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

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

Introduction

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

Prototype

public static boolean deleteQuietly(File file) 

Source Link

Document

Deletes a file, never throwing an exception.

Usage

From source file:com.unister.semweb.drums.api.DRUMSIteratorTest.java

@Before
public void initialise() throws Exception {
    new File(TestUtils.gp.DATABASE_DIRECTORY).mkdirs();
    long[] ranges = new long[] { 0, 10, 20, 30 };
    byte[][] bRanges = KeyUtils.toByteArray(ranges);
    String[] filenames = new String[] { "1.db", "2", "3.db", "4.db" };
    FileUtils.deleteQuietly(new File(TestUtils.gp.DATABASE_DIRECTORY));
    this.hashFunction = new RangeHashFunction(bRanges, filenames, "/tmp/hash.hs");

    // fill with data
    table = DRUMSInstantiator.createTable(hashFunction, TestUtils.gp);
    // remember, the element with key 0 is ignored
    generatedData = TestUtils.createDummyData(1, 50);
    Arrays.sort(generatedData, new AbstractKVStorableComparator());
    table.insertOrMerge(generatedData);/*from   w ww  . j av a2 s  . co m*/
    table.close();
}

From source file:com.bancvue.mongomigrate.CreateCommandTests.java

@After
public void tearDown() throws IOException {
    // Delete all js files in that the test may have created.
    File directory = new File(".");
    Collection<File> files = FileUtils.listFiles(directory, new WildcardFileFilter("*.js"), null);
    for (File file : files) {
        FileUtils.deleteQuietly(file);
    }//from w w  w  . ja  v  a 2s  .c  o m

    // Delete migrations folder
    File migrationsFolder = new File("migrations");
    FileUtils.deleteDirectory(migrationsFolder);
}

From source file:com.gs.obevo.db.apps.reveng.AseAquaRevengMainTest.java

@Test
public void testAseWithIndex() {
    AquaRevengMain reveng = new AquaRevengMain();

    File input = new File("./src/test/resources/reveng/ase/input-with-index");
    File outputDir = new File("./target/reveng-test/ase/output-with-index");
    FileUtils.deleteQuietly(outputDir);
    File expected = new File("./src/test/resources/reveng/ase/expected-withindexes");

    String argsStr = format("-mode schema -inputDir %s -outputDir %s -generateBaseline -dbType %s -dbSchema %s",
            input, outputDir, "SYBASE_ASE", "dbdeploy01");
    AquaRevengArgs args = new ArgsParser().parse(argsStr.split(" "), new AquaRevengArgs());

    reveng.execute(args);//from  www  .  j a  va 2 s . c om

    DirectoryAssert.assertDirectoriesEqual(expected, new File(outputDir, "final"));
}

From source file:com.gs.obevo.impl.EnabledOnboardingStrategyTest.java

@Before
public void setup() {
    testDir = new File("./target/EnabledOnboardingTest");
    FileUtils.deleteQuietly(testDir);
}

From source file:com.switchfly.compress.cli.CompressCLITest.java

@After
public void tearDown() throws Exception {
    FileUtils.deleteDirectory(_outputLocation);
    FileUtils.deleteQuietly(_outputFile);
}

From source file:ml.shifu.shifu.util.IndependentTreeModelUtilsTest.java

@Test
public void testConvertZipToBinary() throws IOException {
    File input = new File("src/test/resources/example/readablespec/model0.zip");
    File output = new File("src/test/resources/example/readablespec/model1.gbt");
    IndependentTreeModelUtils utils = new IndependentTreeModelUtils();
    utils.convertZipSpecToBinary(input, output);

    FileInputStream inputStream = new FileInputStream(output);
    IndependentTreeModel treeModel = IndependentTreeModel.loadFromStream(inputStream);
    Assert.assertTrue(treeModel != null);

    FileUtils.deleteQuietly(output);
}

From source file:edu.mda.bioinfo.ids.TcgaIdConverter.java

public void getAndPrepFiles() throws IOException, Exception {
    System.out.println("getAndPrepFiles start");
    File downloadDir = new File(mBaseDir, "downloads");
    System.out.println("getAndPrepFiles clear download dir");
    FileUtils.deleteQuietly(downloadDir);
    System.out.println("getAndPrepFiles make download dir");
    downloadDir.mkdir();/*from  w ww .ja v a  2s .com*/
    System.out.println("getAndPrepFiles DownloadFiles");
    DownloadFiles df = new DownloadFiles(downloadDir.getAbsolutePath());
    df.downloadFiles();
    System.out.println("getAndPrepFiles UncompressFiles");
    UncompressFiles uf = new UncompressFiles(downloadDir.getAbsolutePath());
    uf.uncompressFiles();
    System.out.println("getAndPrepFiles PrepFiles");
    PrepFiles pf = new PrepFiles(downloadDir.getAbsolutePath());
    pf.prepFiles();
    System.out.println("getAndPrepFiles done");
}

From source file:com.adaptris.util.stream.StreamUtilTest.java

@Test
public void testCreateFile() throws Exception {
    int bytes = TEXT.length();
    ByteArrayInputStream in = new ByteArrayInputStream(TEXT.getBytes());
    File f = StreamUtil.createFile(in, bytes);
    assertNotNull(f);//from   www.j  ava 2  s  .co  m
    assertEquals(TEXT, new String(read(f)));
    FileUtils.deleteQuietly(f);
}

From source file:de.idos.updates.configuration.ConfiguredUpdateSystem_FtpTest.java

@After
public void deleteInstalledUpdates() throws Exception {
    String userHome = System.getProperty("user.home");
    FileUtils.deleteQuietly(new File(userHome, ".updateunittest"));
}

From source file:com.linkedin.pinot.common.utils.TarGzCompressionUtilsTest.java

@AfterMethod
public void tearDownTest() {
    if (TEST_DIR != null) {
        FileUtils.deleteQuietly(TEST_DIR);
    }
}