List of usage examples for org.apache.commons.io FileUtils copyDirectoryToDirectory
public static void copyDirectoryToDirectory(File srcDir, File destDir) throws IOException
From source file:org.mobicents.servlet.restcomm.RvdProjectsMigrationHelper.java
public void backupWorkspace() throws RvdProjectsMigrationException { try {/* w w w. j ava 2 s. c o m*/ File workspace = new File(this.workspacePath); File workspaceBackup = new File( this.workspaceBackupPath + File.separator + "workspaceBackup-" + DateTime.now().getMillis()); FileUtils.copyDirectoryToDirectory(workspace, workspaceBackup); } catch (IOException e) { throw new RvdProjectsMigrationException("[ERROR-CODE:13] Error while creating backup for RVD workspace", 13); } }
From source file:org.mule.test.infrastructure.process.Controller.java
protected void deployDomain(String domain) { File domainFile = new File(domain); verify(domainFile.exists(), "Domain does not exist: %s", domain); try {/*from w w w . ja va2 s. c o m*/ if (domainFile.isDirectory()) { FileUtils.copyDirectoryToDirectory(domainFile, this.domainsDir); } else { FileUtils.copyFileToDirectory(domainFile, this.domainsDir); } } catch (IOException e) { throw new MuleControllerException(String.format(DOMAIN_DEPLOY_ERROR, domain), e); } }
From source file:org.mule.test.infrastructure.process.Controller.java
public void deploy(String path) { File app = new File(path); verify(app.exists(), "File does not exists: %s", app); verify(app.canRead(), "Cannot read file: %s", app); try {/* ww w .j av a2 s . c o m*/ if (app.isFile()) { FileUtils.copyFileToDirectory(app, appsDir); } else { FileUtils.copyDirectoryToDirectory(app, appsDir); } } catch (IOException e) { throw new MuleControllerException("Could not deploy app [" + path + "] to [" + appsDir + "]", e); } }
From source file:org.n52.wps.ags.algorithmpackage.AlgorithmPackage.java
public AlgorithmPackage createChild(File destinationRoot) throws IOException { FileUtils.copyDirectoryToDirectory(algorithmWorkspace, destinationRoot); File wsDir = new File(destinationRoot.getAbsolutePath() + File.separator + getWorkspacePathFragment()); AlgorithmPackage child = new AlgorithmPackage(processDescription, algorithmDescription, wsDir); return child; }
From source file:org.n52.wps.server.feed.movingcode.MovingCodeObject.java
public MovingCodeObject createChild(File destinationRoot) throws IOException { FileUtils.copyDirectoryToDirectory(algorithmWorkspace, destinationRoot); File wsDir = new File(destinationRoot.getAbsolutePath() + File.separator + getWorkspacePathFragment()); MovingCodeObject child = new MovingCodeObject(processDescription, algorithmDescription, wsDir); return child; }
From source file:org.nanoko.coffeemill.mojos.packaging.PackageAssetsMojo.java
public void execute() throws MojoExecutionException { if (isSkipped()) { return;// w ww . ja v a 2s . c o m } if (!this.getWorkDirectory().exists()) { getLog().warn("/!\\ Packaging assets skipped - " + this.getWorkDirectory().getAbsolutePath() + " does not exist !"); return; } File[] workAssets = getWorkDirectory().listFiles(); try { for (File file : workAssets) { if (file.isDirectory()) { FileUtils.copyDirectoryToDirectory(file, getBuildDirectory()); } else { if (file.isFile() && !FSUtils.hasExtension(file, "js", "css")) { FileUtils.copyFileToDirectory(file, getBuildDirectory()); } } } } catch (IOException e) { throw new MojoExecutionException("Error during execute() on PackageAssetsMojo", e); } }
From source file:org.nuxeo.ecm.user.center.profile.UserProfileFeature.java
protected String deployDataFiles() throws IOException { File src = new File(org.nuxeo.common.utils.FileUtils.getResourcePathFromContext("data")); File dst = Framework.createTempFile("nuxeoImportTest", ".dir"); dst.delete();/* w w w. jav a 2 s .c o m*/ dst.mkdir(); Framework.getProperties().setProperty(UserProfileImporter.BLOB_FOLDER_PROPERTY, dst.getPath() + "/data"); FileUtils.copyDirectoryToDirectory(src, dst); return dst.getPath(); }
From source file:org.nuxeo.platform.scanimporter.tests.ImportTestCase.java
protected String deployTestFiles(String name) throws IOException { File src = new File(org.nuxeo.common.utils.FileUtils.getResourcePathFromContext("data/" + name)); File dst = File.createTempFile("nuxeoImportTestCase", ".dir"); dst.delete();//from w w w.j a va 2 s .c o m dst.mkdir(); Framework.getProperties().put("nuxeo.import.tmpdir", dst.getPath()); tmp.add(dst); FileUtils.copyDirectoryToDirectory(src, dst); return dst.getPath() + File.separator + name; }
From source file:org.onebusaway.util.FileUtility.java
/** * Copy the sourceDirectory to the given destinationDirectory */// www .j a va 2s . c om public void copyDir(String sourceDirectoryPath, String destinationDirectoryPath) throws IOException { File sourceDir = new File(sourceDirectoryPath); File destinationDir = new File(destinationDirectoryPath); FileUtils.copyDirectoryToDirectory(sourceDir, destinationDir); }
From source file:org.opencastproject.manager.core.MetadataDocumentHandler.java
/** * Copy files.//from w ww . ja v a 2 s. co m * * @param srcFile * @param srcDir */ public void moveDocumentDirectory(File srcFile, File destDir) { try { FileUtils.forceMkdir(destDir); FileUtils.copyDirectoryToDirectory(srcFile, destDir); FileUtils.deleteDirectory(srcFile); } catch (Exception e) { logger.error("Workflow editor could not move document directory."); } }