List of utility methods to do Folder Copy nio
void | copyFolder(File sourceFolder, File destinationFolder) copy Folder copyFolder(sourceFolder, destinationFolder, true); |
void | copyFolder(File sourceFolder, File destinationFolder) copy Folder if (sourceFolder.isDirectory()) { if (!destinationFolder.exists()) { destinationFolder.mkdirs(); String files[] = sourceFolder.list(); for (String file : files) { File srcFile = new File(sourceFolder, file); File destFile = new File(destinationFolder, file); ... |
void | copyFolder(File sourceFolder, File destinationFolder, List copy Folder copyFolder(sourceFolder, destinationFolder, true, blacklist); |
void | copyFolder(File src, File dest) copy Folder if (src.isDirectory()) { if (!dest.exists()) { dest.mkdir(); String files[] = src.list(); for (String file : files) { File srcFile = new File(src, file); File destFile = new File(dest, file); ... |
void | copyFolder(File src, File dest) copy Folder if (src.isDirectory()) { if (!dest.exists()) { dest.mkdir(); String files[] = src.list(); for (String file : files) { File srcFile = new File(src, file); File destFile = new File(dest, file); ... |
void | copyFolder(File src, File dst, FilenameFilter filter) copy Folder if (src.isDirectory()) { if (!dst.exists()) { dst.mkdir(); String files[] = src.list(filter); for (String file : files) { File srcFile = new File(src, file); File destFile = new File(dst, file); ... |
void | copyFolder(final File from, final File to) copy a full folder recursively assert !to.exists() || to.isDirectory(); if (!to.exists()) { to.mkdirs(); if (!from.isDirectory()) { copy(from.getAbsolutePath(), new File(to, from.getName()).getAbsolutePath()); } else { final File newDestDir = new File(to, from.getName()); ... |
boolean | copyFolder(String path, String resultPath) copy Folder File file = new File(path); File result = new File(resultPath); try { Files.copy(file.toPath(), result.toPath(), StandardCopyOption.REPLACE_EXISTING); } catch (IOException e) { e.printStackTrace(); return false; if (file.isDirectory()) { for (File other : file.listFiles()) { if (!copyFolder(other.getPath(), result.getPath() + "\\" + other.getName())) return false; return true; |
void | copyFolderNio(String oldpathall, String newpath) copy Folder Nio String newpathall = newpath + File.separator + new File(oldpathall).getName(); FileChannel inputChannel = null; FileChannel outputChannel = null; try { inputChannel = new FileInputStream(oldpathall).getChannel(); outputChannel = new FileOutputStream(newpathall).getChannel(); outputChannel.transferFrom(inputChannel, 0, inputChannel.size()); } finally { ... |
void | copyFolders(File sourceFolder, File destFolder) copy Folders if (!destFolder.exists()) destFolder.mkdirs(); File[] listFiles = sourceFolder.listFiles(); if (listFiles != null) { for (File srcFile : listFiles) { if (srcFile.isDirectory()) copyFolders(srcFile, new File(destFolder, srcFile.getName())); if (srcFile.isFile()) { ... |