Android Utililty Methods Folder Copy

List of utility methods to do Folder Copy

Description

The list of methods to do Folder Copy are organized into topic(s).

Method

voidcopyFolder(File sF, File tF)
copy Folder
String sP = sF.getAbsolutePath().replace("\\", "/");
String tP = tF.getAbsolutePath().replace("\\", "/");
List<File> alls = getAllFiles(sF);
for (File f : alls) {
    String path = f.getAbsolutePath().replace("\\", "/");
    path = path.replace(sP, tP);
    copyFile(f, new File(path));
voidcopyFolder(File src, File dest)
Copies a folder from the given source to the given destination.
if (src.isDirectory()) {
    if (!dest.exists()) {
        dest.mkdir();
        System.out.println("Directory copied from " + src + "  to "
                + dest);
    String files[] = src.list();
    for (String file : files) {
...
voidcopyFolder(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);
...
voidcopyFolder(String from, String target, List ingores)
copy Folder
File file = new File(from);
if (file.isFile()) {
    copyFile(from, target);
} else {
    if (ingores == null || !ingores.contains(file.getName())) {
        if (!file.exists()) {
            file.mkdir();
        String[] fileList;
        fileList = file.list();
        for (int i = 0; i < fileList.length; i++) {
            copyFolder(from + "/" + fileList[i], target + "/"
                    + fileList[i], ingores);
voidcopyFolder(File fromFolder, File toFolder)
copy Folder
if (!fromFolder.exists()) {
    return;
if (toFolder.exists()) {
    deleteFileAndFolder(toFolder);
copyFolder(fromFolder.getAbsolutePath(), toFolder.getAbsolutePath());
voidcopyFolder(String sourceDir, String targetDir)
copy Folder
(new File(targetDir)).mkdirs();
File[] file = (new File(sourceDir)).listFiles();
for (int i = 0; i < file.length; i++) {
    if (file[i].isFile()) {
        File sourceFile = file[i];
        File targetFile = new File(
                new File(targetDir).getAbsolutePath()
                        + File.separator + file[i].getName());
...
booleancreateFolder(String path)
create Folder
boolean made = true;
File dir = new File(path);
if (!dir.exists()) {
    made = dir.mkdirs();
return made;
voidcopyFolder(File fromFolder, File toFolder)
copy Folder
if (!fromFolder.exists()) {
    return;
if (toFolder.exists()) {
    deleteFileAndFolder(toFolder);
copyFolder(fromFolder.getAbsolutePath(), toFolder.getAbsolutePath());
voidcopyFolder(File fromFolder, File toFolder)
copy Folder
if (!fromFolder.exists()) {
    return;
if (toFolder.exists()) {
    deleteFileAndFolder(toFolder);
copyFolder(fromFolder.getAbsolutePath(), toFolder.getAbsolutePath());
voidcopyFolder(String sourceDir, String targetDir)
copy Folder
(new File(targetDir)).mkdirs();
File[] file = (new File(sourceDir)).listFiles();
for (int i = 0; i < file.length; i++) {
    if (file[i].isFile()) {
        File sourceFile = file[i];
        File targetFile = new File(
                new File(targetDir).getAbsolutePath()
                        + File.separator + file[i].getName());
...