public final class Strings extends Object
| Modifier and Type | Method and Description |
|---|---|
static List<String> |
expandGlob(String globPattern)
Expands a string with braces ("{}") into all of its possible permutations.
|
static List<WildcardPath> |
expandGlobToWildCardPaths(String globPattern,
char delim)
Expands a string according to
expandGlob(String), and then constructs a WildcardPath
for each expanded result which can be used to match strings as described in WildcardPath. |
static boolean |
isNullOrEmpty(String s)
Returns true if s.isEmpty() or s == null
|
static String |
join(Iterable<String> s,
String on)
Deprecated.
|
static String |
join(Iterator<String> iter,
String on)
Deprecated.
|
static String |
join(String[] s,
String on)
Deprecated.
|
@Deprecated public static String join(Iterable<String> s, String on)
String.join(CharSequence, Iterable)s - an iterable of stringson - the delimiter@Deprecated public static String join(Iterator<String> iter, String on)
String.join(CharSequence, Iterable)iter - an iterator of stringson - the delimiter@Deprecated public static String join(String[] s, String on)
String.join(CharSequence, Iterable)s - an iterable of stringson - the delimiterpublic static boolean isNullOrEmpty(String s)
s - a string that may be null or emptypublic static List<String> expandGlob(String globPattern)
The only special characters in this glob syntax are '}', '{' and ','
The top-level pattern must not contain any commas, but a "one-of" group separates its elements with commas, and a one-of group may contain sub one-of groups.
For example: start{a,b,c}end -> startaend, startbend, startcend start{a,{b,c},d} -> startaend, startbend, startcend, startdend {a,b,c} -> a, b, c start{a, b{x,y}} -> starta, startbx, startby
globPattern - a string in the format described abovepublic static List<WildcardPath> expandGlobToWildCardPaths(String globPattern, char delim)
expandGlob(String), and then constructs a WildcardPath
for each expanded result which can be used to match strings as described in WildcardPath.globPattern - a String to be passed to expandGlob(String)delim - the delimeter used by WildcardPathCopyright © 2023 The Apache Software Foundation. All rights reserved.