Android Directory Create createDir(String dir, boolean ignoreIfExitst)

Here you can find the source of createDir(String dir, boolean ignoreIfExitst)

Description

create Dir

Declaration

public static void createDir(String dir, boolean ignoreIfExitst)
        throws IOException 

Method Source Code

//package com.java2s;

import java.io.File;

import java.io.IOException;

public class Main {

    public static void createDir(String dir, boolean ignoreIfExitst)
            throws IOException {
        File file = new File(dir);
        if (ignoreIfExitst && file.exists()) {
            return;
        }/*w w w  . ja va2 s .  c o m*/
        if (file.mkdir() == false) {
            throw new IOException("Cannot create the directory = " + dir);
        }
    }
}

Related

  1. createDir(String dirName)
  2. createDir(String directory)
  3. createDir(String path)
  4. createDir(final File path)