public static boolean createDirectory(String directory){
  File theDir=new File(directory);
  if (!theDir.exists()) {
    boolean result=false;
    try {
      theDir.mkdirs();
      result=true;
    }
 catch (    SecurityException se) {
      se.printStackTrace();
      return false;
    }
    return result;
  }
 else {
    return true;
  }
}

public static boolean createDirectory ( String directory ) { File theDir = new File ( directory ) ; if ( ! theDir . exists ( ) ) { boolean result = false ; try { theDir . mkdirs ( ) ; result = true ; } catch ( SecurityException se ) { se . printStackTrace ( ) ; return false ; } return result ; } else { return true ; } }
create directory if not exists
