org.mockftpserver.core.util
Class PatternUtil

java.lang.Object
  extended by org.mockftpserver.core.util.PatternUtil

public class PatternUtil
extends Object

Contains static utility methods related to pattern-matching and regular expressions.

Version:
$Revision: 240 $ - $Date: 2010-03-19 20:28:25 -0400 (Fri, 19 Mar 2010) $
Author:
Chris Mair

Method Summary
static boolean containsWildcards(String string)
          Return true if the specified String contains one or more wildcard characters ('?' or '*')
static String convertStringWithWildcardsToRegex(String stringWithWildcards)
          Convert the specified String, optionally containing wildcards (? or *), to a regular expression String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

containsWildcards

public static boolean containsWildcards(String string)
Return true if the specified String contains one or more wildcard characters ('?' or '*')

Parameters:
string - - the String to check
Returns:
true if the String contains wildcards

convertStringWithWildcardsToRegex

public static String convertStringWithWildcardsToRegex(String stringWithWildcards)
Convert the specified String, optionally containing wildcards (? or *), to a regular expression String

Parameters:
stringWithWildcards - - the String to convert, optionally containing wildcards (? or *)
Returns:
an equivalent regex String
Throws:
AssertionError - - if the stringWithWildcards is null


Copyright © 2014. All rights reserved.