public class Strings2 extends Object
Constructor and Description |
---|
Strings2() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isUrlEncoded(String in) |
static String |
replaceAll(String input,
char match,
String replacement) |
static String |
replaceAll(String returnVal,
Pattern pattern,
String replace) |
static String |
replaceTokens(String input,
Map<String,String> replacements)
replaces tokens that are expressed as
{token}
ex. |
static String |
replaceTokens(String input,
com.google.common.collect.Multimap<String,?> tokenValues) |
static InputStream |
toInputStream(String in) |
static String |
toString(com.google.common.io.InputSupplier<? extends InputStream> supplier) |
static String |
toStringAndClose(InputStream input) |
static String |
urlDecode(Object in)
url decodes the input param, if set.
|
static String |
urlEncode(String in,
char... skipEncode)
Web browsers do not always handle '+' characters well, use the well-supported '%20' instead.
|
static String |
urlEncode(String in,
Iterable<Character> skipEncode) |
public static String urlEncode(String in, char... skipEncode)
public static boolean isUrlEncoded(String in)
public static String urlDecode(@Nullable Object in)
in
- nullableIllegalStateException
- if encoding isn't UTF-8
public static String toString(com.google.common.io.InputSupplier<? extends InputStream> supplier) throws IOException
IOException
public static String toStringAndClose(InputStream input) throws IOException
IOException
public static InputStream toInputStream(String in)
public static String replaceTokens(String input, Map<String,String> replacements)
{token}
ex. if input is "hello {where}"input
- source to replacereplacements
- token/value pairsCopyright © 2009-2013 jclouds. All Rights Reserved.