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:io.github.swagger2markup.GeneralConverterTest.java

@Test
public void testFromPathURI() throws IOException, URISyntaxException {
    //Given/*from  w  ww  .  j a  va  2 s .  c  om*/
    Path outputDirectory = Paths.get("build/test/asciidoc/pathUri");
    FileUtils.deleteQuietly(outputDirectory.toFile());

    //When
    Swagger2MarkupConverter.from(Paths.get("src/test/resources/yaml/swagger_petstore.yaml").toUri()).build()
            .toFolder(outputDirectory);

    //Then
    String[] files = outputDirectory.toFile().list();
    assertThat(files).hasSize(4).containsAll(expectedFiles);
}

From source file:com.galenframework.reports.model.FileTempStorage.java

/**
 * Removes all temporary files from disk.
 * IMPORTANT! Use this call only in the end
 * when you are sure you don't need report files anymore
 *//*ww w .  jav a 2  s.  c  o  m*/
public void cleanup() {
    if (this.childStorages != null) {
        for (FileTempStorage storage : this.childStorages) {
            storage.cleanup();
        }
    }

    for (File file : this.files.values()) {
        FileUtils.deleteQuietly(file);
    }
    this.files.clear();
}

From source file:com.greenpepper.runner.CommandLineRunnerTest.java

@After
public void tearDown() throws Exception {
    deleteOutputDirectory();/* w ww  .  ja  v a2  s  . c  o m*/
    String input = getResourcePath("/specs/ABankSample.html");
    FileUtils.deleteQuietly(new File(input + ".out.html"));
}

From source file:edu.usc.goffish.gofs.itest.KryoSerializerIntegrationTest.java

public void testKryoSerialization() throws IOException {
    Path sliceDir = Files.createTempDirectory("slices");
    try {/*from   ww  w  .  j a  va2 s . c o  m*/
        GMLPartition gmlPartition = GMLPartition.parseGML(1, new WCCComponentizer(),
                ClassLoader.getSystemResourceAsStream(TemplateFile), new GMLFileIterable(InstanceFiles));

        // Write the partition
        UUID partitionUUID = UUID.randomUUID();
        ISliceManager sliceManager = SliceManager.create(partitionUUID, new KryoSliceSerializer(),
                new FileStorageManager(sliceDir));
        sliceManager.writePartition(gmlPartition, 1, gmlPartition.size());

        // Read the partition
        sliceManager = SliceManager.create(partitionUUID, new KryoSliceSerializer(),
                new FileStorageManager(sliceDir));
        IPartition actualPartition = sliceManager.readPartition();
        assertNotNull(actualPartition);

        // Test the partition
        comparePartitionTemplates(gmlPartition, actualPartition);
        comparePartitionInstances(actualPartition);

    } finally {
        FileUtils.deleteQuietly(sliceDir.toFile());
    }
}

From source file:edu.umn.msi.tropix.common.io.IOContextsTest.java

@Test(groups = "unit")
public void inputForFileFunction() throws IOException {
    final File file1 = File.createTempFile("tpx", "tst"), file2 = File.createTempFile("tpx", "tst");
    try {//from   w  w  w .jav  a 2  s.co m
        FileUtils.writeStringToFile(file1, "Moo Cow");

        final InputContext inputContext = InputContexts.getForFileFunction().apply(file1);
        inputContext.get(file2);
        final String contents = FileUtils.readFileToString(file2);
        assert contents.equals("Moo Cow") : contents;
    } finally {
        FileUtils.deleteQuietly(file1);
        FileUtils.deleteQuietly(file2);
    }
}

From source file:com.linkedin.pinot.core.segment.index.creator.SegmentGenerationWithTimeColumnTest.java

@BeforeMethod
public void reset() {
    minTime = Long.MAX_VALUE;
    maxTime = Long.MIN_VALUE;
    FileUtils.deleteQuietly(new File(SEGMENT_DIR_NAME));
}

From source file:com.datatorrent.stram.util.LogFileInformationTest.java

@AfterClass
public static void tearDown() {
    Logger.getRootLogger().removeAppender(APPENDER_NAME);
    FileUtils.deleteQuietly(new File(logFileName).getParentFile());
}

From source file:com.thoughtworks.go.config.materials.svn.SvnMultipleMaterialsTest.java

@Test
public void shouldNotThrowNPEIfTheWorkingDirectoryIsEmpty() throws Exception {
    SvnMaterial svnMaterial1 = repo.createMaterial("multiple-materials/trunk/part1", "part1");
    SvnMaterial svnMaterial2 = repo.createMaterial("multiple-materials/trunk/part2", "part2");
    Materials materials = new Materials(svnMaterial1, svnMaterial2);

    Revision revision = latestRevision(svnMaterial1, pipelineDir, new TestSubprocessExecutionContext());
    updateMaterials(materials, revision);

    FileUtils.deleteQuietly(pipelineDir);

    updateMaterials(materials, revision);
}

From source file:com.cloudera.knittingboar.records.TestTwentyNewsgroupsCustomRecordParseOLRRun.java

@After
public void teardown() throws Exception {
    FileUtils.deleteQuietly(baseDir);
}

From source file:integration.BfPixelBufferTest.java

private void tidyUp() throws Throwable {
    FileUtils.deleteQuietly(destPath);
    rps.close();
}