fr.paris.lutece.plugins.form.utils
Class StringUtil

java.lang.Object
  extended by fr.paris.lutece.plugins.form.utils.StringUtil

public final class StringUtil
extends java.lang.Object

StringUtil


Method Summary
static byte[] convertToByte(java.lang.String strToConvert)
          Convert a String to byte[].
static java.lang.String convertToString(byte[] toConvert)
          Convert a byte[] to a String.
static java.lang.String getConversionEncoding()
          Get the conversion encoding defined in form.response.encoding
static boolean isConversionEnable()
          Check if the conversion is enable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

convertToString

public static java.lang.String convertToString(byte[] toConvert)
Convert a byte[] to a String.
If the conversion with a specified encoding is not enable, then it will use the default encoding.

Parameters:
strToConvert - the String to convert
Returns:
the convert String if there is no error, the String in the parameter otherwise

convertToByte

public static byte[] convertToByte(java.lang.String strToConvert)
Convert a String to byte[].
If the conversion encoding is enable, then it will use the encoding defined in form.response.encoding, otherwise it will use the default encoding

Parameters:
strToConvert - the String to convert
Returns:
a String converted in byte[]

isConversionEnable

public static boolean isConversionEnable()
Check if the conversion is enable.
It is defined in the form.response.encoding.enable.

Returns:
true if the conversion is enable, false otherwise

getConversionEncoding

public static java.lang.String getConversionEncoding()
Get the conversion encoding defined in form.response.encoding

Returns:
the conversion encoding


Copyright © 2012 Mairie de Paris. All Rights Reserved.