code: public static String getUriPath(String value) {
          try {
              URL url = new URL(value);
              return url.getPath();
          } catch (MalformedURLException e) {
              return value;
          }
      }
docs: This method extracts the 'path' component of a
  URL. If the supplied value is not a valid URL
  format, then it will simply return the supplied
  value.
  
  @param value The URI value
  @return The path of a URL, or the value returned as is