Class UriEncoder


  • public abstract class UriEncoder
    extends java.lang.Object
    To be decided
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static Escaper escaper  
      private static java.lang.String SAFE_CHARS  
      private static java.nio.charset.CharsetDecoder UTF8Decoder  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private UriEncoder()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String decode​(java.lang.String buff)
      Decode with URLDecoder
      static java.lang.String decode​(java.nio.ByteBuffer buff)
      Decode '%'-escaped characters.
      static java.lang.String encode​(java.lang.String uri)
      Escape special characters with '%'
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • UTF8Decoder

        private static final java.nio.charset.CharsetDecoder UTF8Decoder
      • escaper

        private static final Escaper escaper
    • Constructor Detail

      • UriEncoder

        private UriEncoder()
    • Method Detail

      • encode

        public static java.lang.String encode​(java.lang.String uri)
        Escape special characters with '%'
        Parameters:
        uri - URI to be escaped
        Returns:
        encoded URI
      • decode

        public static java.lang.String decode​(java.nio.ByteBuffer buff)
                                       throws java.nio.charset.CharacterCodingException
        Decode '%'-escaped characters. Decoding fails in case of invalid UTF-8
        Parameters:
        buff - data to decode
        Returns:
        decoded data
        Throws:
        java.nio.charset.CharacterCodingException - if cannot be decoded
      • decode

        public static java.lang.String decode​(java.lang.String buff)
        Decode with URLDecoder
        Parameters:
        buff - - the source
        Returns:
        decoded with UTF-8