create Folder If Not Exists - Android java.io

Android examples for java.io:Folder

Description

create Folder If Not Exists

Demo Code

import java.io.File;
public class Main{

    public static boolean createFolderIfNotExists(String path) {
        File folder = new File(path);
        if (folder.exists())
            return true;
        else//from   ww w  . j av  a  2s.  c om
            return folder.mkdirs();
    }

}

Related Tutorials