Example usage for java.io File mkdirs

List of usage examples for java.io File mkdirs

Introduction

In this page you can find the example usage for java.io File mkdirs.

Prototype

public boolean mkdirs() 

Source Link

Document

Creates the directory named by this abstract pathname, including any necessary but nonexistent parent directories.

Usage

From source file:Main.java

public static void createDirectory(String path) {
    File file = new File(path);
    if (!file.exists()) {
        file.mkdirs();
    }/*ww w.  j  a va 2  s. co  m*/
}

From source file:Main.java

public static String createNewFile(String path) {
    File dir = new File(path);
    if (!dir.exists()) {
        dir.mkdirs();
    }/*from  w  w  w. j  a v  a 2s. co m*/
    return path;
}

From source file:Main.java

private static String getImageCacheDir(Context context) {
    String dir = context.getCacheDir() + "cache" + File.separator;
    File file = new File(dir);
    if (!file.exists())
        file.mkdirs();
    return dir;//from w  w  w.  j a v  a2  s.  co  m
}

From source file:Main.java

public static void makeDir(String dirName) {
    File dir = new File(dirName);
    if (!dir.exists()) {
        dir.mkdirs();
    }/*from  w  w  w  . ja va 2  s . c om*/
}

From source file:Main.java

public static void createFileDir(String path) {
    File file = new File(path);
    if (!file.exists()) {
        file.mkdirs();
    }/*from   ww  w.j  ava 2s. c  o  m*/
}

From source file:Main.java

public static void mkdirs(String directory) {
    File dir = new File(directory);
    if (!dir.exists()) {
        dir.mkdirs();
    }// ww  w.j  av  a  2s.  c  o m
}

From source file:Main.java

public static void ensureDirExists(File dir) {
    if (!dir.exists() || !dir.isDirectory()) {
        dir.mkdirs();
    }//from   w  w  w .j  a  v  a  2  s .co  m
}

From source file:Main.java

public static void createDir(String dirPath) {
    File file = new File(dirPath);
    if (!file.exists()) {
        file.mkdirs();
    }//from   ww  w  .j a va  2 s .  c  om
}

From source file:Main.java

public static File getSDCardSoPath() {
    String fileStr = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator;
    File f = new File(fileStr);
    if (!f.exists()) {
        f.mkdirs();
    }//from  w  w w.  ja va2  s  . c  om
    return f;
}

From source file:Main.java

public static void checkDir(String dirPath) {
    File dir = new File(dirPath);

    if (!dir.exists()) {
        dir.mkdirs();
    }//from  www  .j a  v  a 2 s  .c  om
}