复制文件夹:
public static boolean copyFolder(String srcFolderFullPath, String destFolderFullPath) {
try {
(new File(destFolderFullPath)).mkdirs(); // 如果文件夹不存在 则建立新文件夹
File file = new File(srcFolderFullPath);
String[] files = file.list();
File temp = null;
for (int i = 0; i < files.length; i++) {
if (srcFolderFullPath.endsWith(File.separator)) {
temp = new File(srcFolderFullPath + files[i]);
} else {
temp = new File(srcFolderFullPath + File.separator + files[i]);
}
if (temp.isFile()) {
FileInputStream input = new FileInputStream(temp);
copyFile(input, destFolderFullPath + "/" + (temp.getName()).toString());
}
if (temp.isDirectory()) {// 如果是子文件夹
copyFolder(srcFolderFullPath + "/" + files[i], destFolderFullPath + "/" + files[i]);
}
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}public static boolean copyFolder(String