Java Path Copy nio copyFiles(String srcPath, String destPath)

Here you can find the source of copyFiles(String srcPath, String destPath)

Description

copy Files

License

Open Source License

Declaration

private static void copyFiles(String srcPath, String destPath) throws Throwable 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.File;

import java.nio.file.Files;
import java.nio.file.StandardCopyOption;

public class Main {
    private static void copyFiles(String srcPath, String destPath) throws Throwable {
        File srcDir = new File(srcPath);
        File destDir = new File(destPath);
        if (!destDir.exists())
            new File(destPath).mkdirs();
        destDir = new File(destPath);
        Files.copy(srcDir.toPath(), destDir.toPath(), StandardCopyOption.REPLACE_EXISTING);

    }//from w  w  w .  ja v a2  s  .co m
}

Related

  1. copyFile(Path srcFile, Path srcDir, Path dstDir)
  2. copyFile(String srcPath, String destPath)
  3. copyFile(String urlPath, String outFile)
  4. copyFileFromResourcesToServer(String resourceFile, Path targetDirectory, boolean override)
  5. copyFiles()
  6. copyFiles(String urlDir, String outPath)
  7. copyFilesAndApplyPermissions(Path sourceDir, Path targetDir, List filenames)
  8. copyFilesRecursively(final Path from, final Path to)
  9. copyFileToArchive(InputStream srcInputStream, Path destPath)