com.sapportals.portal.prt.util

Class DeprecatedStringUtils

java.lang.Object
  extended by com.sapportals.portal.prt.util.DeprecatedStringUtils

Deprecated. Use the class XSSEncoder instead

public class DeprecatedStringUtils
extends Object

This Class was created to delegate all portal internal usages of StringUtils to the new com.sap.security.core.server.csi.XSSEncode Do not use it in any future development

Most of the methods of this class are depreciated. Please use the class XSSEncoder for encoding / escaping according the SAP XSS Secure Programming Guide

See Also:
XSSEncoder

Field Summary
protected static StringBufferPool BUFFER_POOL_URLS
          Deprecated.  
protected static int URL_SIZE
          Deprecated.  
 
Constructor Summary
DeprecatedStringUtils()
          Deprecated.  
 
Method Summary
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 String urlEncode(String s)
          Deprecated. Use the class XSSEncoder method encodeURL instead
static String urlEncode(String s, char[] forceEncode)
          Deprecated. Use the class XSSEncoder method encodeURL instead
static SharedString urlEncodeShared(String s, char[] forceEncode)
          Deprecated. Use the class XSSEncoder method encodeURL instead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFFER_POOL_URLS

protected static StringBufferPool BUFFER_POOL_URLS
Deprecated. 

URL_SIZE

protected static int URL_SIZE
Deprecated. 
Constructor Detail

DeprecatedStringUtils

public DeprecatedStringUtils()
Deprecated. 
Method Detail

escapeToJS

public static String escapeToJS(String input)
Deprecated. Use the class XSSEncoder method encodeJavaScript instead

Encode a string inside a JS string declaration (CASE5)

Parameters:
input - The string to parse.

escapeToJS

public static String escapeToJS(String input,
                                int maxLength)
Deprecated. Use the class XSSEncoder method encodeJavaScript instead

Encode a string inside a JS string declaration (CASE5)

Parameters:
input - The string to parse.
maxLength - The maximum length the String input SHOULD have

escapeToHTML

public static String escapeToHTML(String input)
Deprecated. Use the class XSSEncoder method encodeHTML instead

Encode a string for output between tags (CASE1)

Parameters:
input - The string to parse.

escapeToHTML

public static String escapeToHTML(String input,
                                  int maxLength)
Deprecated. Use the class XSSEncoder method encodeHTML instead

Encode a string for output between tags (CASE1)

Parameters:
input - The string to parse.
maxLength - The maximum length the String input SHOULD have

escapeToAttributeValue

public static String escapeToAttributeValue(String input)
Deprecated. Use the class XSSEncoder method encodeHTML instead

Encode a string for output as an attribute string of a tag, no URLs! (CASE2)

Parameters:
input - The string to parse.

escapeToAttributeValue

public static String escapeToAttributeValue(String input,
                                            int maxLength)
Deprecated. Use the class XSSEncoder method encodeHTML instead

Encode a string for output as an attribute string of a tag, no URLs! (CASE2)

Parameters:
input - The string to parse.
maxLength - The maximum length the String input SHOULD have

escapeToURL

public static String escapeToURL(String input)
Deprecated. Use the class XSSEncoder method encodeHTML instead

Encode a string that represents a URL (CASE3) Note that this function will call 'disableScriptSignatures'. Please read the note on that function as well.

Parameters:
input - The string to parse.

escapeToURL

public static String escapeToURL(String input,
                                 int maxLength)
Deprecated. Use the class XSSEncoder method encodeHTML instead

Encode a string that represents a URL (CASE3) Note that this function will call 'disableScriptSignatures'. Please read the note on that function as well.

Parameters:
input - The string to parse.
maxLength - The maximum length the String input SHOULD have

escapeScriptEndTag

public static String escapeScriptEndTag(String pStr)
Deprecated. Use the class XSSEncoder instead

Prepare a string to be used for a javascript string definition with particular care about script tag. In particular this fixes html parsing problems with </script>.

Parameters:
pStr - input The string to parse.

urlEncode

public static String urlEncode(String s,
                               char[] forceEncode)
Deprecated. Use the class XSSEncoder method encodeURL instead

This is an extended version of the URLEncoder.encode method. It allows to specify more characters to be encoded.

Parameters:
s - The String to be encoded
forceEncode - An array of chars that are to be encoded explicitly. Note: forceEncode should NOT contain digits nor the percent sign!!

urlEncode

public static String urlEncode(String s)
Deprecated. Use the class XSSEncoder method encodeURL instead

A trivial replacement of URLEncoder.encode

Parameters:
s - The String to be encoded

urlEncodeShared

public static SharedString urlEncodeShared(String s,
                                           char[] forceEncode)
Deprecated. Use the class XSSEncoder method encodeURL instead

This is an extended version of the URLEncoder.encode method. It allows to specify more characters to be encoded.

Parameters:
s - The Shared String to be encoded.
One has to call SharedString.release() in order to free the underlying string resource!
forceEncode - An array of chars that are to be encoded explicitly. Note: forceEncode should NOT contain digits nor the percent sign!!
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] EP-BASIS-API [sap.com] epbc.prtapi._apideprecated 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 2015 SAP AG Complete Copyright Notice