org.apache.ftpserver.util
Class StringUtils

java.lang.Object
  extended by org.apache.ftpserver.util.StringUtils

public class StringUtils
extends Object

String utility methods.

Author:
Rana Bhattacharyya

Constructor Summary
StringUtils()
           
 
Method Summary
static String formatHtml(String source, boolean bReplaceNl, boolean bReplaceTag, boolean bReplaceQuote)
          This method is used to insert HTML block dynamically
static String pad(String src, char padChar, boolean rightPad, int totalLength)
          Pad string object
static String replaceString(String source, Map args)
          Replace string
static String replaceString(String source, Object[] args)
          Replace string
static String replaceString(String source, String oldStr, String newStr)
          This is a string replacement method.
static byte[] toByteArray(String hexString)
          Get byte array from hex string
static String toHexString(byte[] res)
          Get hex string from byte array
 
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

replaceString

public static String replaceString(String source,
                                   String oldStr,
                                   String newStr)
This is a string replacement method.


replaceString

public static String replaceString(String source,
                                   Object[] args)
Replace string


replaceString

public static String replaceString(String source,
                                   Map args)
Replace string


formatHtml

public static String formatHtml(String source,
                                boolean bReplaceNl,
                                boolean bReplaceTag,
                                boolean bReplaceQuote)
This method is used to insert HTML block dynamically

Parameters:
source - the HTML code to be processes
bReplaceNl - if true '\n' will be replaced by
bReplaceTag - if true '<' will be replaced by < and '>' will be replaced by >
bReplaceQuote - if true '\"' will be replaced by "

pad

public static String pad(String src,
                         char padChar,
                         boolean rightPad,
                         int totalLength)
Pad string object


toHexString

public static String toHexString(byte[] res)
Get hex string from byte array


toByteArray

public static byte[] toByteArray(String hexString)
Get byte array from hex string



Copyright © 2001-2012 Codehaus. All Rights Reserved.