code: public static String decode( String url )
      {
          if ( url == null )
          {
              return null;
          }
          StringBuilder decoded = new StringBuilder();
          int pos = 0;
          while (pos < url.length()) 
          {
              char ch = url.charAt(pos);
              if (ch == '%')
              {
                  if ( pos + 2 < url.length() )
                  {
                      String hexStr = url.substring( pos + 1, pos + 3 );
                      char hexChar = (char) Integer.parseInt( hexStr, 16 );
                      decoded.append( hexChar );
                      pos += 3;
                  }
                  else 
                  {
                      throw new IllegalStateException("'%' escape must be followed by two hex digits");
                  }
              }
              else
              {
                  decoded.append( ch );
                  pos++;
              }
          }
          return decoded.toString();
      }
docs: Decodes the specified (portion of a) URL. <strong>Note:</strong> This decoder assumes that ISO-8859-1 is used to
  convert URL-encoded octets to characters.
  
  @param url The URL to decode, may be <code>null</code>.
  @return The decoded URL or <code>null</code> if the input was <code>null</code>.