code: public static File createTempDirectory(String _path, String _name, boolean _deleteOnExit) {
  
          File outputDir = new File(concatFilePath(_path, _name));
          if (!outputDir.exists()) {
              try {
                  Files.createDirectory(Paths.get(outputDir.toString()));
              } catch (IOException _ex) {
                  LOGGER.error("Error while creating temp directory: ", _ex);
              }
          } else {
              return null;
          }
          if (_deleteOnExit) {
              outputDir.deleteOnExit();
          }
          return outputDir;
      }
docs: Creates a new temporary directory in the given path.
  @param _path path
  @param _name directory name
  @param _deleteOnExit delete directory on jvm shutdown
  @return created Directory, null if directory/file was already existing