code: public static Path removeExtension(Path path, String... extensions) {
      String pathString = path.toString();
      for (String extension : extensions) {
        pathString = StringUtils.remove(pathString, extension);
      }
  
      return new Path(pathString);
    }
docs: Removes all <code>extensions</code> from <code>path</code> if they exist.
  
  <pre>
  PathUtils.removeExtention("file.txt", ".txt")                      = file
  PathUtils.removeExtention("file.txt.gpg", ".txt", ".gpg")          = file
  PathUtils.removeExtention("file", ".txt")                          = file
  PathUtils.removeExtention("file.txt", ".tar.gz")                   = file.txt
  PathUtils.removeExtention("file.txt.gpg", ".txt")                  = file.gpg
  PathUtils.removeExtention("file.txt.gpg", ".gpg")                  = file.txt
  </pre>
  
  @param path in which the <code>extensions</code> need to be removed
  @param extensions to be removed
  
  @return a new {@link Path} without <code>extensions</code>