code: public static boolean dirIsUseable(final String aDirName, final String aPermString) {
          final File dir = new File(aDirName);
  
          if (!dir.exists() && !dir.mkdirs()) {
              return false;
          } else if ("r".contains(aPermString)) {
              return dir.canRead();
          } else if ("w".contains(aPermString)) {
              return dir.canWrite();
          } else if ("x".contains(aPermString)) {
              return dir.canExecute();
          } else {
              return true;
          }
      }
docs: Tests that the supplied directory exists and can be used according to the supplied permissions string (e.g.,
  'rwx').
  
  @param aDirName A name of a directory on the file system
  @param aPermString A string representing the desired permissions of the directory
  @return True if the directory is okay to be used; else, false