Android Directory Create makehome(String home)

Here you can find the source of makehome(String home)

Description

create a directory

Parameter

Parameter Description
home a parameter

Exception

Parameter Description
Exception an exception

Declaration

public static void makehome(String home) throws Exception 

Method Source Code

//package com.java2s;
import java.io.*;

public class Main {
    /**//from   w  w w .  j  a  v a2  s  . co  m
     * create a directory
     * @param home
     * @throws Exception
     */
    public static void makehome(String home) throws Exception {
        File homedir = new File(home);
        if (!homedir.exists()) {
            try {
                homedir.mkdirs();
            } catch (Exception ex) {
                throw new Exception("Can not mkdir :" + home
                        + " Maybe include special charactor!");
            }
        }
    }
}

Related

  1. ensureDirectoryExist(File dir)
  2. getDir(String path)
  3. isParentDirectoryCreationRequired(File file)
  4. join(String dir, String subDir)
  5. makeDirs(File f)
  6. mkDir(String dirName)
  7. mkDir(String path)
  8. mkdir(File path)
  9. mkdir(String filePath)