code: private static File createWorkspace(final String prefix,
                                          final String suffix,
                                          final File parent,
                                          final boolean deleteIfExists) throws IOException {
          final File dir = getUserDirectory(prefix, suffix, parent);
          if (dir.exists()) {
              if(!dir.isDirectory()) {
                  throw new IOException("File " + dir + " exists but is not a directory");
              }
              if (deleteIfExists) {
                  FileUtils.cleanDirectory(dir);
              }
          } else {
              if (!dir.mkdir()) {
                  throw new IOException("Failed to create directory: " + dir);
              }
          }
          return dir;
      }
docs: Creates a directory with a given suffix and prefix in the parent directory.
  If the absolute path exists and is not a directory, throws IOException
  If deleteIfExists is true and directory exists, its contents will be
  deleted prior to returning.
  Otherwise, a new directory will be created: throws IOException if fails to create a new directory
  @param suffix
  @param parent
  @param deleteIfExists
  @return