code: public static String encodeUrl(String path) {
          if (path != null) {
              path = path.replaceAll(">", "%3E");
              path = path.replaceAll("<", "%3C");
              path = path.replaceAll(" ", "%20");
          }
          return path;
      }
docs: URL encoding for a resource path (without the encoding for the '/' path delimiters).
  
  @param path the path to encode
  @return the URL encoded path