Package org.jclouds.util
Class Strings2
java.lang.Object
org.jclouds.util.Strings2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isCidrFormat
(String in) static boolean
isIPv6CIDR
(String in) static String
replaceTokens
(String input, com.google.common.collect.Multimap<String, ?> tokenValues) static String
replaceTokens
(String input, Map<String, String> replacements) replaces tokens that are expressed as{token}
static InputStream
toInputStream
(String in) static String
toStringAndClose
(InputStream input) static String
url decodes the input param, if set.static String
Web browsers do not always handle '+' characters well, use the well-supported '%20' instead.static String
-
Constructor Details
-
Strings2
public Strings2()
-
-
Method Details
-
urlEncode
Web browsers do not always handle '+' characters well, use the well-supported '%20' instead. -
urlEncode
-
isCidrFormat
-
isIPv6CIDR
-
urlDecode
url decodes the input param, if set.- Parameters:
in
- nullable- Returns:
- null if input was null
- Throws:
IllegalStateException
- if encoding isn'tUTF-8
-
toStringAndClose
- Throws:
IOException
-
toInputStream
-
replaceTokens
replaces tokens that are expressed as{token}
ex. if input is "hello {where}"
and replacements is "where" -> "world"
then replaceTokens returns "hello world"- Parameters:
input
- source to replacereplacements
- token/value pairs
-
replaceTokens
-