public class EscapeStrings
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
_allowableInDAP |
protected static java.lang.String |
_allowableInOGC |
protected static java.lang.String |
_allowableInUrl |
protected static java.lang.String |
_allowableInUrlQuery |
protected static java.lang.String |
_disallowedInOGC |
protected static java.lang.String |
_namAllowedInDAP |
protected static java.lang.String |
_namAllowedInOGC |
protected static char |
_URIEscape |
protected static java.lang.String |
alpha |
protected static java.lang.String |
alphaNumeric |
protected static java.lang.String |
dapSpecAllowed |
protected static java.lang.String |
httpclient_queryillegal |
protected static java.lang.String |
httpclient_querylegal |
protected static java.lang.String |
httpclient_urlillegal |
protected static java.lang.String |
httpclient_urllegal |
static org.slf4j.Logger |
log |
protected static java.lang.String |
nonAlphaNumeric |
protected static java.lang.String |
numeric |
protected static java.lang.String |
opendap_identifier_characters |
protected static java.lang.String |
opendap_identifier_special_characters |
protected static java.lang.String |
queryIdentAllowed |
protected static java.lang.String |
queryIdentDisallowed |
protected static java.lang.String |
queryReserved |
protected static java.lang.String |
urlAllowed |
protected static java.lang.String |
urlDisallowed |
protected static java.lang.String |
urlReserved |
Constructor and Description |
---|
EscapeStrings() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
backslashEscape(java.lang.String x,
java.lang.String reservedChars)
backslash escape a string
|
static java.lang.String |
backslashEscapeDapString(java.lang.String s)
Given a DAP (attribute) string, insert backslashes
before '"' and '/' characters.
|
static java.lang.String |
backslashToDAP(java.lang.String bs)
Given a backslash escaped name,
convert to a DAP escaped name
|
static java.lang.String |
backslashUnescape(java.lang.String x)
backslash unescape a string
|
static java.lang.String |
escapeDAPIdentifier(java.lang.String s)
Define the DAP escape identifier function.
|
static java.lang.String |
escapeOGC(java.lang.String s)
Define the OGC Web Services escape function.
|
static java.lang.String |
escapeURL(java.lang.String url) |
static java.lang.String |
escapeURLQuery(java.lang.String ce)
Define the DEFINITIVE URL constraint expression escape function.
|
static int |
indexOf(java.lang.String escapedName,
char c)
Find first occurence of char c in escapedName, excluding escaped c.
|
static void |
main(java.lang.String[] args) |
static void |
main2(java.lang.String[] args) |
static void |
mainOld(java.lang.String[] args) |
static java.lang.String |
normalizeToXML(java.lang.String s) |
static void |
testOGC() |
static java.util.List<java.lang.String> |
tokenizeEscapedName(java.lang.String escapedName)
Tokenize an escaped name using "." as delimiter, skipping "\."
|
static java.lang.String |
unescapeDAPIdentifier(java.lang.String id)
Define the DEFINITIVE opendap identifier unescape function.
|
static java.lang.String |
unescapeOGC(java.lang.String s)
Define the OGC unescape function.
|
static java.lang.String |
unescapeURL(java.lang.String url)
Decode all of the parts of the url including query and fragment
|
static java.lang.String |
unescapeURLQuery(java.lang.String ce)
Define the DEFINITIVE URL constraint expression unescape function.
|
static java.lang.String |
urlDecode(java.lang.String s)
Define the DEFINITIVE URL unescape function.
|
public static org.slf4j.Logger log
protected static final java.lang.String alpha
protected static final java.lang.String numeric
protected static final java.lang.String alphaNumeric
protected static final java.lang.String httpclient_urllegal
protected static final java.lang.String httpclient_querylegal
protected static final java.lang.String httpclient_urlillegal
protected static final java.lang.String httpclient_queryillegal
protected static final java.lang.String nonAlphaNumeric
protected static final java.lang.String queryReserved
protected static final java.lang.String urlReserved
protected static final java.lang.String urlDisallowed
protected static final java.lang.String urlAllowed
protected static final java.lang.String _allowableInUrl
protected static final java.lang.String queryIdentDisallowed
protected static final java.lang.String queryIdentAllowed
protected static final java.lang.String _allowableInUrlQuery
protected static final java.lang.String dapSpecAllowed
protected static final java.lang.String _namAllowedInDAP
protected static final java.lang.String _allowableInDAP
protected static final java.lang.String _namAllowedInOGC
protected static final java.lang.String _disallowedInOGC
protected static final java.lang.String _allowableInOGC
protected static final java.lang.String opendap_identifier_special_characters
protected static final java.lang.String opendap_identifier_characters
protected static final char _URIEscape
public static java.lang.String unescapeDAPIdentifier(java.lang.String id)
id
- The identifier to unescape.public static java.lang.String escapeURL(java.lang.String url)
public static java.lang.String escapeURLQuery(java.lang.String ce)
ce
- The expression to modify.public static java.lang.String unescapeURLQuery(java.lang.String ce)
ce
- The expression to unescape.public static java.lang.String urlDecode(java.lang.String s)
s
- The string to unescape.public static java.lang.String unescapeURL(java.lang.String url)
url
- the url to encodepublic static java.lang.String escapeDAPIdentifier(java.lang.String s)
s
- The string to encode.public static java.lang.String escapeOGC(java.lang.String s)
s
- The string to encode.public static void testOGC()
public static java.lang.String unescapeOGC(java.lang.String s)
s
- The string to unescape. bpublic static java.lang.String backslashEscape(java.lang.String x, java.lang.String reservedChars)
x
- escape this; may be nullreservedChars
- these chars get a backslash in front of thempublic static java.lang.String backslashUnescape(java.lang.String x)
x
- unescape thispublic static java.util.List<java.lang.String> tokenizeEscapedName(java.lang.String escapedName)
escapedName
- an escaped namepublic static int indexOf(java.lang.String escapedName, char c)
escapedName
- search in this stringc
- for this char but not \\chapublic static void main2(java.lang.String[] args)
public static void main(java.lang.String[] args)
public static void mainOld(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public static java.lang.String normalizeToXML(java.lang.String s)
public static java.lang.String backslashToDAP(java.lang.String bs)
bs
- the string to DAP encode; may have backslash escapespublic static java.lang.String backslashEscapeDapString(java.lang.String s)