Class URLUtils

java.lang.Object
org.restheart.utils.URLUtils

public class URLUtils extends Object
Author:
Andrea Di Cesare <andrea@softinstigate.com>
  • Constructor Details

    • URLUtils

      protected URLUtils()
  • Method Details

    • removeTrailingSlashes

      public static String removeTrailingSlashes(String s)
      given string /ciao/this/has/trailings///// returns /ciao/this/has/trailings
      Parameters:
      s -
      Returns:
      the string s without the trailing slashes
    • decodeQueryString

      public static String decodeQueryString(String qs)
      decode the percent encoded query string
      Parameters:
      qs -
      Returns:
      the decoded query string
    • decodeQueryString

      public static String decodeQueryString(String qs, String enc)
      decode the percent encoded query string
      Parameters:
      qs -
      enc - encoding name
      Returns:
      the decoded query string
    • decodeQueryString

      public static String decodeQueryString(io.undertow.server.HttpServerExchange exchange)
      decode the percent encoded query string
      Parameters:
      exchange -
      Returns:
      the decoded query string
    • getParentPath

      public static String getParentPath(String path)
      Parameters:
      path -
      Returns:
      the parent path of path
    • getPrefixUrl

      public static String getPrefixUrl(io.undertow.server.HttpServerExchange exchange)
      Parameters:
      exchange -
      Returns:
      the prefix url of the exchange
    • getQueryStringRemovingParams

      public static String getQueryStringRemovingParams(io.undertow.server.HttpServerExchange exchange, String... paramsToRemove)
      Parameters:
      exchange -
      paramsToRemove -
      Returns:
    • getIdString

      public static String getIdString(org.bson.BsonValue id) throws UnsupportedDocumentIdException
      Parameters:
      id -
      Returns:
      Throws:
      UnsupportedDocumentIdException