code: public static String cleanPath(String path) throws InvalidPathException {
      validatePath(path);
      return FilenameUtils.separatorsToUnix(FilenameUtils.normalizeNoEndSeparator(path));
    }
docs: Checks and normalizes the given path.
  
  @param path The path to clean up
  @return a normalized version of the path, with single separators between path components and
  dot components resolved
  @throws InvalidPathException if the path is invalid