com.silverpeas.ical
Class StringUtils

java.lang.Object
  extended by com.silverpeas.ical.StringUtils

public final class StringUtils
extends Object

Common String utilities (formatters, converters, etc).


Constructor Summary
StringUtils()
           
 
Method Summary
static String decodeBASE64(String string)
          Decodes a BASE64-encoded string.
static String decodePassword(String encodedPassword)
           
static String decodeToString(byte[] bytes, Charset encoding)
           
static String decodeToString(byte[] bytes, String encoding)
           
static String encodeBASE64(byte[] data)
          Encode the input bytes into BASE64 format.
static byte[] encodeString(String string, Charset encoding)
           
static byte[] encodeString(String string, String encoding)
           
static long stringToLong(String string)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtils

public StringUtils()
Method Detail

encodeString

public static byte[] encodeString(String string,
                                  Charset encoding)
                           throws CharacterCodingException
Throws:
CharacterCodingException

encodeString

public static byte[] encodeString(String string,
                                  String encoding)
                           throws CharacterCodingException
Throws:
CharacterCodingException

decodeToString

public static String decodeToString(byte[] bytes,
                                    String encoding)

decodeToString

public static String decodeToString(byte[] bytes,
                                    Charset encoding)

decodePassword

public static String decodePassword(String encodedPassword)
                             throws Exception
Throws:
Exception

stringToLong

public static long stringToLong(String string)
                         throws NumberFormatException
Throws:
NumberFormatException

decodeBASE64

public static String decodeBASE64(String string)
Decodes a BASE64-encoded string.

Parameters:
string - BASE64 string
Returns:
String the decoded bytes
Throws:
UnsupportedEncodingException

encodeBASE64

public static String encodeBASE64(byte[] data)
Encode the input bytes into BASE64 format.

Parameters:
data - - byte array to encode
Returns:
encoded string


Copyright © 2016 Silverpeas. All Rights Reserved.