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

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

Introduction

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

Prototype

public static void copyDirectory(File srcDir, File destDir) throws IOException 

Source Link

Document

Copies a whole directory to a new location preserving the file dates.

Usage

From source file:com.googlecode.t7mp.CommonsSetupUtil.java

@Override
public void copyDirectory(File source, File target) throws IOException {
    FileUtils.copyDirectory(source, target);
}

From source file:es.amplia.research.maven.protodocbook.tools.FileHelper.java

public static boolean copyDir(File _in, File _out) {
    try {//from w w  w .  j av a2s  .  co  m
        log.info("Copying " + _in.getName() + " to " + _out.getAbsolutePath());
        FileUtils.copyDirectory(_in, _out);
        return true;
    } catch (IOException e) {
        log.error("File copy error", e);
        return false;
    }
}

From source file:com.sap.prd.mobile.ios.mios.XCodeTest.java

protected void ensureCleanProjectDirectoryAndFilterPom(final File projectDirectory) throws Exception {
    File source = new File(new File(".").getAbsoluteFile(), "src/test/projects");

    MacFileUtil.deleteDirectory(projectDirectory);
    FileUtils.copyDirectory(source, projectDirectory);
    filterPoms(projectDirectory);/*from   ww  w .  j av a2 s . c  o m*/
}

From source file:de.flapdoodle.embed.mongo.config.processlistener.CopyDbFilesIntoDirBeforeProcessStart.java

@Override
public void onBeforeProcessStart(File dbDir, boolean dbDirIsTemp) {
    try {//w  ww .  j a  v  a  2 s . c  o  m
        FileUtils.copyDirectory(_source, dbDir);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}

From source file:com.google.cloud.tools.gradle.endpoints.framework.ProjectTests.java

@Test
public void testClientServerIntegrationBuilds() throws IOException, URISyntaxException {
    FileUtils.copyDirectory(new File(getClass().getClassLoader().getResource("projects/clientserver").toURI()),
            testProjectDir.getRoot());/*from   ww  w .  ja  v a2 s . com*/
    BuildResult buildResult = GradleRunner.create().withProjectDir(testProjectDir.getRoot())
            .withPluginClasspath().withArguments("assemble").build();
}

From source file:de.oppermann.pomutils.MainCallTest.java

@Override
protected void setUp() throws Exception {
    super.setUp();

    File targetDirectory = new File("target/testresources/mainCall");
    FileUtils.deleteDirectory(targetDirectory);
    FileUtils.copyDirectory(new File("src/test/resources/mainCall"), targetDirectory);
}

From source file:au.org.ala.delta.delfor.DelforTest.java

@Before
public void setUp() throws Exception {
    File dataSetDirectory = urlToFile("/dataset");
    File dest = new File(System.getProperty("java.io.tmpdir"));
    FileUtils.copyDirectory(dataSetDirectory, dest);
    _path = dest.getAbsolutePath();//from   w w  w .j a  v a 2s.c  om
}

From source file:ml.shifu.shifu.udf.CalculateReasonCodeUDFTest.java

@BeforeClass
public void setUp() throws Exception {
    File tmpCommon = new File("common");
    File common = new File("src/test/resources/common");
    FileUtils.copyDirectory(common, tmpCommon);

    Environment.setProperty(Environment.SHIFU_HOME, ".");
    instance = new CalculateReasonCodeUDF("LOCAL",
            "src/test/resources/example/cancer-judgement/ModelStore/ModelSet1/ModelConfig.json",
            "src/test/resources/example/cancer-judgement/ModelStore/ModelSet1/ColumnConfig.json", "EvalA");
}

From source file:asciidoc.maven.plugin.tools.FileHelper.java

public static boolean copyDir(File _in, File _out) {
    try {/*from   ww w  . j  a  v a  2  s.  c om*/
        //System.out.println("Copying "+ _in.getAbsolutePath() + " to " + _out.getAbsolutePath());
        log.info("Copying " + _in.getAbsolutePath() + " to " + _out.getAbsolutePath());
        FileUtils.copyDirectory(_in, _out);
        return true;
    } catch (IOException e) {
        log.error("File copy error", e);
        return false;
    }
}

From source file:ml.shifu.shifu.udf.SimpleScoreUDFTest.java

@BeforeClass
public void setUp() throws Exception {
    File models = new File("src/test/resources/example/cancer-judgement/ModelStore/ModelSet1/models");
    FileUtils.copyDirectory(models, tmpModels);

    instance = new SimpleScoreUDF("LOCAL",
            "src/test/resources/example/cancer-judgement/ModelStore/ModelSet1/ModelConfig.json",
            "src/test/resources/example/cancer-judgement/ModelStore/ModelSet1/ColumnConfig.json",
            "src/test/resources/example/cancer-judgement/DataStore/DataSet1/.pig_header", "|");
}