Esri Geoportal Server
1.0

com.esri.gpt.framework.security.codec
Class Base64

java.lang.Object
  extended by com.esri.gpt.framework.security.codec.Base64

public class Base64
extends Object

Handles base64 encoding/decoding.


Method Summary
static String decode(String data, String charset)
          This method decodes the given string using the base64 encoding specified in RFC-2045 (Section 6.8).
static String encode(String data, String charset)
          This method encodes the given string using the base64 encoding specified in RFC-2045 (Section 6.8).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encode

public static final String encode(String data,
                                  String charset)
                           throws UnsupportedEncodingException
This method encodes the given string using the base64 encoding specified in RFC-2045 (Section 6.8). It's used for example in the "Basic" authorization scheme.

Parameters:
data - the string to encode
charset - the character set (if not supplied UTF-8 will be used)
Returns:
the base64 encoded string
Throws:
UnsupportedEncodingException - if the exception occurs

decode

public static final String decode(String data,
                                  String charset)
                           throws IOException
This method decodes the given string using the base64 encoding specified in RFC-2045 (Section 6.8).

Parameters:
data - the base64 encoded string.
charset - the character set (if not supplied UTF-8 will be used)
Returns:
the decoded string
Throws:
IOException

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.