Package ucar.nc2.util
Class EscapeStrings
java.lang.Object
ucar.nc2.util.EscapeStrings
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbackslashEscape(String x, String reservedChars) backslash escape a stringstatic StringbackslashEscapeCDMString(String s, String toescape) Given a CDM string, insert backslashes beforecharacters. static StringGiven a DAP (attribute) string, insert backslashes before '"' and '/' characters.static StringbackslashToDAP(String bs) Given a backslash escaped name, convert to a DAP escaped namestatic Stringbackslash unescape a stringstatic StringDefine the DAP escape identifier function.static StringDefine the OGC Web Services escape function.static StringDeprecated.do not usestatic StringescapeURLQuery(String ce) Define the DEFINITIVE URL constraint expression escape function.static intFind first occurence of char c in escapedName, excluding escaped c.static StringDeprecated.do not usestatic voidtestOGC()tokenizeEscapedName(String escapedName) Tokenize an escaped name using "." as delimiter, skipping "\."static StringDefine the DEFINITIVE opendap identifier unescape function.static StringunescapeURL(String url) Decode all of the parts of the url including query and fragmentstatic StringDefine the DEFINITIVE URL constraint expression unescape function.static StringDefine the DEFINITIVE URL unescape function.
-
Constructor Details
-
EscapeStrings
public EscapeStrings()
-
-
Method Details
-
unescapeDAPIdentifier
Define the DEFINITIVE opendap identifier unescape function.- Parameters:
id- The identifier to unescape.- Returns:
- The unescaped identifier.
-
escapeURL
Deprecated.do not use -
escapeURLQuery
Define the DEFINITIVE URL constraint expression escape function.- Parameters:
ce- The expression to modify.- Returns:
- The escaped expression.
-
unescapeURLQuery
Define the DEFINITIVE URL constraint expression unescape function.- Parameters:
ce- The expression to unescape.- Returns:
- The unescaped expression.
-
urlDecode
Define the DEFINITIVE URL unescape function.- Parameters:
s- The string to unescape.- Returns:
- The unescaped expression.
-
unescapeURL
Decode all of the parts of the url including query and fragment- Parameters:
url- the url to encode
-
escapeDAPIdentifier
Define the DAP escape identifier function.- Parameters:
s- The string to encode.- Returns:
- The escaped string.
-
escapeOGC
Define the OGC Web Services escape function.- Parameters:
s- The string to encode.- Returns:
- The escaped string.
-
testOGC
public static void testOGC() -
backslashEscape
backslash escape a string- Parameters:
x- escape this; may be nullreservedChars- these chars get a backslash in front of them- Returns:
- escaped string
-
backslashUnescape
backslash unescape a string- Parameters:
x- unescape this- Returns:
- string with \c -> c
-
tokenizeEscapedName
Tokenize an escaped name using "." as delimiter, skipping "\."- Parameters:
escapedName- an escaped name- Returns:
- list of tokens
-
indexOf
Find first occurence of char c in escapedName, excluding escaped c.- Parameters:
escapedName- search in this stringc- for this char but not \\cha- Returns:
- pos in string, or -1
-
normalizeToXML
Deprecated.do not use -
backslashToDAP
Given a backslash escaped name, convert to a DAP escaped name- Parameters:
bs- the string to DAP encode; may have backslash escapes- Returns:
- escaped string
-
backslashEscapeDapString
Given a DAP (attribute) string, insert backslashes before '"' and '/' characters. This code also escapes control characters, although the spec does not call for it; make that code conditional. -
backslashEscapeCDMString
Given a CDM string, insert backslashes beforecharacters.
-