private static synchronized boolean checkFolderPermissions(StringBuilder aStringBuilder,String aDirectory){
  File directory=new File(aDirectory);
  if (!directory.exists()) {
    directory.mkdirs();
  }
  if (!directory.canRead()) {
    aStringBuilder.append("The directory [" + directory + "] is not readable. "+ "Please check your permissions rights.\n");
    return false;
  }
  if (!directory.canWrite()) {
    aStringBuilder.append("The directory [" + directory + "] is not writable. "+ "Please check your permissions rights.\n");
    return false;
  }
  return true;
}

private static synchronized boolean checkFolderPermissions ( StringBuilder aStringBuilder , String aDirectory ) { File directory = new File ( aDirectory ) ; if ( ! directory . exists ( ) ) { directory . mkdirs ( ) ; } if ( ! directory . canRead ( ) ) { aStringBuilder . append ( "The directory [" + directory + "] is not readable. " + "Please check your permissions rights.\n" ) ; return false ; } if ( ! directory . canWrite ( ) ) { aStringBuilder . append ( "The directory [" + directory + "] is not writable. " + "Please check your permissions rights.\n" ) ; return false ; } return true ; }
checks if a directory already exists . if it does not exist it is created . if it already exists then , its permissions are ok .
