code: static public String normalize(String path) {
      if (path == null || path.length() == 0) return ROOT;
      
      if (path.charAt(0) != PATH_SEPARATOR) {
        throw new IllegalArgumentException(
                                           "Network Location path does not start with "
                                           +PATH_SEPARATOR_STR+ ": "+path);
      }
      
      int len = path.length();
      if (path.charAt(len-1) == PATH_SEPARATOR) {
        return path.substring(0, len-1);
      }
      return path;
    }
docs: Normalize a path