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.thoughtworks.go.server.service.AgentRuntimeInfoTest.java

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

From source file:gov.nih.nci.cabig.caaers.testdata.TestDataFileUtils.java

/**
 * Will delete the file/*from  ww w .  j a v a2 s  . c  om*/
 * @param folder
 * @param fileName
 * @throws Exception
 */
public static void deleteFile(File folder, String fileName) throws Exception {
    FileUtils.deleteQuietly(getFileObject(folder, fileName));
}

From source file:com.github.ipaas.ideploy.agent.handler.UpdateCodeHandler.java

@Override
public void execute(String flowId, String cmd, Map<String, Object> params, BundleContext bundleContext)
        throws Exception {

    logger.debug("?: flowId:" + flowId + "  cmd:" + cmd + "  params:" + params);

    String srcPath = String.valueOf(params.get("srcPath"));
    String targetPath = String.valueOf(params.get("targetPath"));

    UpdateCodeUtil.updateCode(srcPath, targetPath);

    // //from   w w  w.j  av  a2s.co m
    FileUtils.deleteQuietly(new File(srcPath));

    try {
        // ? owner
        logger.info("? owner nobody");
        ShellUtil.execQuietly(CHOWN_COMMAND + targetPath);
    } catch (Exception e) {
        logger.error("? owner ");
    }

    logger.debug("??...");
}

From source file:com.adaptris.util.datastore.TestSimpleDataStore.java

@After
public void tearDown() throws Exception {
    File f = new File(dataStoreProperties.getProperty(SimpleDataStore.FILE_PROPERTY));
    FileUtils.deleteQuietly(f);
    f = new File(dataStoreProperties.getProperty(SimpleDataStore.LOCK_PROPERTY));
    FileUtils.deleteQuietly(f);//from   w  w  w  . ja v a 2  s  .c o  m

}

From source file:com.linkedin.pinot.core.startree.TestSumStarTreeIndexBackwardCompatibilityTest.java

@BeforeTest
void setup() throws Exception {
    String compressedIndex = TestUtils
            .getFileFromResourceUrl(TestSumStarTreeIndexBackwardCompatibilityTest.class.getClassLoader()
                    .getResource("data/starTreeSegment.tar.gz"));

    _tmpDir = new File(_tmpDirName);
    if (_tmpDir.exists()) {
        FileUtils.deleteQuietly(_tmpDir);
    }/*from   w  ww .  j  av  a  2s  .c o  m*/

    TarGzCompressionUtils.unTar(new File(compressedIndex), _tmpDir);
    File segmentFile = _tmpDir.listFiles()[0];
    _segment = Loaders.IndexSegment.load(segmentFile, ReadMode.heap);
}

From source file:cz.seznam.euphoria.flink.testkit.FlinkExecutorProvider.java

default ExecutorEnvironment newExecutorEnvironment() throws Exception {
    String path = "/tmp/.flink-test-" + System.currentTimeMillis();
    RocksDBStateBackend backend = new RocksDBStateBackend("file://" + path);
    FlinkExecutor executor = new TestFlinkExecutor(ModuloInputSplitAssigner::new).setStateBackend(backend);
    return new ExecutorEnvironment() {
        @Override//from   ww w.ja  v  a2 s.  c  o  m
        public Executor getExecutor() {
            return executor;
        }

        @Override
        public void shutdown() throws Exception {
            executor.shutdown();
            FileUtils.deleteQuietly(new File(path));
        }
    };
}

From source file:com.thoughtworks.go.domain.FileHandlerTest.java

@After
public void tearDown() {
    FileUtils.deleteQuietly(artifact);
}

From source file:com.unister.semweb.drums.file.RepairIndexTest.java

/** Initialises the test by removing the test file. */
@Before/*from  ww  w.  j a  va 2 s.com*/
public void inititalise() throws Exception {
    FileUtils.deleteQuietly(new File(filename));
    globalParameters = new DRUMSParameterSet<TestStorable>(new TestStorable());
    elementsPerChunk = (int) (globalParameters.FILE_CHUNK_SIZE / globalParameters.getElementSize());
}

From source file:ml.shifu.shifu.pig.PigExecutorTest.java

public void test() throws IOException {
    PigExecutor exec = PigExecutor.getExecutor();
    ModelConfig modelConfig = CommonUtils.loadModelConfig(
            "src/test/resources/example/cancer-judgement/ModelStore/ModelSet1/ModelConfig.json",
            SourceType.LOCAL);//from w ww  .  j  ava  2  s. c  om

    Environment.setProperty(Environment.SHIFU_HOME, ".");
    modelConfig.getDataSet().setSource(SourceType.LOCAL);
    exec.submitJob(modelConfig, "src/test/java/ml/shifu/shifu/pig/pigTest.pig");

    FileUtils.deleteQuietly(new File("ModelConfig.json"));
    FileUtils.deleteDirectory(new File("ModelSets"));
}

From source file:joshelser.LimitAndSumColumnsBase.java

@BeforeClass
public static void setup() throws Exception {
    File macDir = new File(System.getProperty("user.dir") + "/target/LimitAndSumColumnsTest");
    if (macDir.exists() && macDir.isDirectory()) {
        FileUtils.deleteQuietly(macDir);
    }/*from   w ww . j  a  v a 2 s . c o  m*/
    Assert.assertTrue(macDir.mkdirs());
    MiniAccumuloConfig cfg = new MiniAccumuloConfig(macDir, PASSWD);
    cfg.setNumTservers(2);
    cluster = new MiniAccumuloCluster(cfg);
    cluster.start();
}