Android Directory Create createDirs(String dir, boolean ignoreIfExitst)

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

Description

create Dirs

Declaration

public static void createDirs(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 createDirs(String dir, boolean ignoreIfExitst)
            throws IOException {
        File file = new File(dir);
        if (ignoreIfExitst && file.exists()) {
            return;
        }//from   w  w w  . j a va 2s . com
        if (file.mkdirs() == false) {
            throw new IOException("Cannot create directories = " + dir);
        }
    }
}

Related

  1. createDir(String path)
  2. createDir(final File path)
  3. createDirIfNotExists(File d)
  4. createDirIfNotExists(String d)
  5. createDirStructureForFile(File file)
  6. createDirsForFile(File file)
  7. createIfDoesntExist(File dir, boolean mustBeReadable, boolean mustBeWritable)
  8. createMissingParentDirectories(File file)
  9. createNewDirectory(String directorPath)