Class URLEncoder

  • All Implemented Interfaces:

    public final class URLEncoder
    extends Object
    implements Cloneable
    This class is very similar to the class. Unfortunately, with there is no way to specify to the which characters should NOT be encoded. This code was moved from
    Craig R. McClanahan, Remy Maucherat
    • Constructor Detail

      • URLEncoder

        public URLEncoder()
    • Method Detail

      • addSafeCharacter

        public void addSafeCharacter​(char c)
      • removeSafeCharacter

        public void removeSafeCharacter​(char c)
      • setEncodeSpaceAsPlus

        public void setEncodeSpaceAsPlus​(boolean encodeSpaceAsPlus)
      • encode

        public String encode​(String path,
                             Charset charset)
        URL encodes the provided path using the given character set.
        path - The path to encode
        charset - The character set to use to convert the path to bytes
        The encoded path