public class StringUtils extends Object
StringUtils is a collection of String utilities in the web environment. Many of the methods of this class serve to get correct and cross-site scripting safe encoding for usage in HTML mark-up, JavaScript String, and URLs.
Most of the methods of this class are depreciated. Please use the class XSSEncoder for encoding / escaping according the SAP XSS Secure Programming GuideXSSEncoder| Modifier and Type | Field and Description |
|---|---|
protected static StringBufferPool |
BUFFER_POOL_URLS
Deprecated.
|
protected static int |
URL_SIZE
Deprecated.
|
| Constructor and Description |
|---|
StringUtils()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
escapeScriptEndTag(String pStr)
Deprecated.
Use the class XSSEncoder instead
|
static String |
escapeToAttributeValue(String input)
Deprecated.
Use the class XSSEncoder method encodeHTML instead
|
static String |
escapeToAttributeValue(String input,
int maxLength)
Deprecated.
Use the class XSSEncoder method encodeHTML instead
|
static String |
escapeToHTML(String input)
Deprecated.
Use the class XSSEncoder method encodeHTML instead
|
static String |
escapeToHTML(String input,
int maxLength)
Deprecated.
Use the class XSSEncoder method encodeHTML instead
|
static String |
escapeToJS(String input)
Deprecated.
Use the class XSSEncoder method encodeJavaScript instead
|
static String |
escapeToJS(String input,
int maxLength)
Deprecated.
Use the class XSSEncoder method encodeJavaScript instead
|
static String |
escapeToURL(String input)
Deprecated.
Use the class XSSEncoder method encodeHTML instead
|
static String |
escapeToURL(String input,
int maxLength)
Deprecated.
Use the class XSSEncoder method encodeHTML instead
|
static boolean |
isEmpty(String str)
Deprecated.
|
static String[] |
tokenize(String szInput,
char delimiter)
Deprecated.
Take the given string and chop it up into a series
of strings.
|
static String[] |
tokenize(String szInput,
String szDelim)
Deprecated.
Take the given string and chop it up into a series
of strings.
|
static List |
tokenizeInList(String szInput,
char delimiter)
Deprecated.
Take the given string and chop it up into a List.
|
static List |
tokenizeInList(String szInput,
String szDelim)
Deprecated.
Take the given string and chop it up into a List
|
static String |
urlEncode(String s)
Deprecated.
Use the class XSSEncoder method escapeURL instead
|
static String |
urlEncode(String s,
char[] forceEncode)
Deprecated.
Use the class XSSEncoder method escapeURL instead
|
static SharedString |
urlEncodeShared(String s,
char[] forceEncode)
Deprecated.
This is an extended version of the URLEncoder.encode method.
|
protected static StringBufferPool BUFFER_POOL_URLS
protected static int URL_SIZE
public static String escapeToJS(String input)
input - The string to parse.public static String escapeToJS(String input, int maxLength)
input - The string to parse.maxLength - The maximum length the String input SHOULD havepublic static String escapeToHTML(String input)
input - The string to parse.public static String escapeToHTML(String input, int maxLength)
input - The string to parse.maxLength - The maximum length the String input SHOULD havepublic static String escapeToAttributeValue(String input)
input - The string to parse.public static String escapeToAttributeValue(String input, int maxLength)
input - The string to parse.maxLength - The maximum length the String input SHOULD havepublic static String escapeToURL(String input)
input - The string to parse.public static String escapeToURL(String input, int maxLength)
input - The string to parse.maxLength - The maximum length the String input SHOULD havepublic static String escapeScriptEndTag(String pStr)
pStr - input The string to parse.public static String urlEncode(String s, char[] forceEncode)
s - The String to be encodedforceEncode - An array of chars that are to be encoded
explicitly. Note: forceEncode should NOT contain digits nor
the percent sign!!public static SharedString urlEncodeShared(String s, char[] forceEncode)
s - The Shared String to be encoded.
forceEncode - An array of chars that are to be encoded
explicitely. Note: forceEncode should NOT contain digits nor
the percent sign!!public static String urlEncode(String s)
s - The String to be encodedpublic static String[] tokenize(String szInput, String szDelim)
szInput - the input StringszDelim - the delimiter stringpublic static List tokenizeInList(String szInput, String szDelim)
szInput - the input StringszDelim - the delimiter stringpublic static String[] tokenize(String szInput, char delimiter)
szInput - the input Stringdelimiter - the delimiter characterpublic static List tokenizeInList(String szInput, char delimiter)
szInput - the input Stringdelimiter - the delimiter characterpublic static boolean isEmpty(String str)
| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] EP-BASIS-API
|
[sap.com]
|
default
|
EP-PIN-PRT
|
[sap.com] EP-BASIS-API
|
[sap.com] tc/epbc/prt/api
|
api
|
EP-PIN
|
[sap.com] EP-BASIS-API
|
[sap.com] tc/epbc/prt/lib/api
|
api
|
EP-PIN
|
[sap.com] EP-RUNTIME
|
[sap.com] tc/ep/semantics/api
|
api
|
EP-PIN
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2021 SAP SE Complete Copyright Notice