Package com.dropbox.core.util
Class StringUtil
java.lang.Object
com.dropbox.core.util.StringUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringbase64Encode(byte[] data) static Stringbase64EncodeGeneric(String digits, byte[] data) static StringbinaryToHex(byte[] data) static StringbinaryToHex(byte[] data, int offset, int length) Convert a string of binary bytes to the equivalent hexadecimal string.static charhexDigit(int i) static StringjavaQuotedLiteral(String value) Given a string, returns the representation of that string as a Java string literal.static StringjavaQuotedLiterals(Iterable<String> value) static StringjavaQuotedLiterals(String[] value) static Stringjoin(Collection<String> strings, String delimiter) static StringShorthand forjavaQuotedLiterals(java.lang.String[]).static StringShorthand forjavaQuotedLiteral(java.lang.String).static StringShorthand forjavaQuotedLiterals(java.lang.String[]).static booleansecureStringEquals(String a, String b) When you're comparing two strings for equality and one of them is a value that could be provided by an attacker and the other is a value that the attacker shouldn't know, use this function to check for equality.static byte[]static StringurlSafeBase64Encode(byte[] data) static Stringutf8ToString(byte[] utf8Data) static Stringutf8ToString(byte[] utf8Data, int offset, int length)
-
Field Details
-
UTF8
-
Base64Digits
- See Also:
-
UrlSafeBase64Digits
- See Also:
-
-
Constructor Details
-
StringUtil
public StringUtil()
-
-
Method Details
-
hexDigit
public static char hexDigit(int i) -
utf8ToString
- Throws:
CharacterCodingException
-
utf8ToString
public static String utf8ToString(byte[] utf8Data, int offset, int length) throws CharacterCodingException - Throws:
CharacterCodingException
-
stringToUtf8
-
javaQuotedLiteral
Given a string, returns the representation of that string as a Java string literal. -
javaQuotedLiterals
-
javaQuotedLiterals
-
jq
Shorthand forjavaQuotedLiteral(java.lang.String). -
jq
Shorthand forjavaQuotedLiterals(java.lang.String[]). -
jq
Shorthand forjavaQuotedLiterals(java.lang.String[]). -
binaryToHex
-
binaryToHex
Convert a string of binary bytes to the equivalent hexadecimal string. The resulting String will have two characters for every byte in the input. -
secureStringEquals
When you're comparing two strings for equality and one of them is a value that could be provided by an attacker and the other is a value that the attacker shouldn't know, use this function to check for equality. Using regularString.equalsis not secure. -
base64Encode
-
urlSafeBase64Encode
-
base64EncodeGeneric
-
join
-