net.sf.hermesftp.utils
Class StringUtils

java.lang.Object
  extended by net.sf.hermesftp.utils.StringUtils

public final class StringUtils
extends java.lang.Object

Utilities for handling strings.

Author:
Behnke

Method Summary
static java.lang.String convertLstToString(java.util.List<java.lang.String> list)
          Converts the passed list to a comma separated string.
static java.lang.String encodeRegex(java.lang.String s)
          Quotes the special characters of a given regular expression string.
static java.lang.Integer[] parseIntegerList(java.lang.String portListStr)
          Parses a string encoded list of integer values.
static boolean validateEmail(java.lang.String email)
          Validates the syntax of the passed email.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

convertLstToString

public static java.lang.String convertLstToString(java.util.List<java.lang.String> list)
Converts the passed list to a comma separated string.

Parameters:
list - The list to be converted.
Returns:
The string.

validateEmail

public static boolean validateEmail(java.lang.String email)
Validates the syntax of the passed email.

Parameters:
email - The email.
Returns:
True, if syntax ok.

encodeRegex

public static java.lang.String encodeRegex(java.lang.String s)
Quotes the special characters of a given regular expression string. Example:
     This.is.an.example  -->  This\.is\.an\.example
 

Parameters:
s - The unencoded string.
Returns:
The encoded string.

parseIntegerList

public static java.lang.Integer[] parseIntegerList(java.lang.String portListStr)
Parses a string encoded list of integer values. The list may include ranges. Example:
    1000-1011,1022,1023,2000-3000
 

Parameters:
portListStr - Encoded list of integer values.
Returns:
List of alle Integers defined by the passed list.


Copyright © 2005-2007 Lars Behnke. All Rights Reserved.