Android Utililty Methods Folder Create

List of utility methods to do Folder Create

Description

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

Method

StringcreatePath(String folderName, String fileName)
create Path
return folderName
        + System.getProperties().getProperty("file.separator")
        + fileName;
voidforceFolderExist(String folder)
Create folder if it's not exist
File flTemp = new File(folder);
if (!flTemp.exists()) {
    if (!flTemp.mkdirs())
        throw new IOException("Could not create folder " + folder);
} else if (!flTemp.isDirectory())
    throw new IOException("A file with name" + folder
            + " already exist");
voidmakeParent(File file)
make Parent
if (file.getParentFile() != null && !file.getParentFile().exists()) {
    file.getParentFile().mkdirs();
voidmakeParent(String file)
make Parent
makeParent(new File(file));
FilegetFolderInTarget(String folderName)
get Folder In Target
File folder = new File(new File("").getAbsoluteFile(), "target"
        + File.separator + folderName);
if (!folder.exists()) {
    folder.mkdirs();
return folder;