public final class NgcStringUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
appendToFilename(String filename,
String appendix)
Appends the given appendix to the given filename.
|
static String |
escapeForHtml(String toEscape)
Escapes a String so that it is safe to be used in HTML.
|
static String |
escapeForJavaScript(String toEscape)
Escapes a String so that it is safe to be used as a function-argument or data value in
JavaScript.
|
static String |
escapeStringForHql(String toEscape,
com.saperion.config.SQLType sqlType)
Escapes the specified string for HQL LIKE usage.
|
static Set<Character> |
getHqlCharsToEscape(com.saperion.config.SQLType sqlType)
Returns the configured set of characters that must be replaced in a string used in a LIKE statement in HQL.
|
static char |
getHqlEscapeCharacter()
Returns the escape-character to be used in HQL.
|
static String |
makeFolderClassName(String folderClassPath)
Converts a folder classe's path to a fully qualified folder class name.
|
static String |
mapToString(Map<?,?> map)
Formats a map as a string for debugging purposes.
|
static boolean |
mustBeEscapedForHql(String toEscape,
com.saperion.config.SQLType sqlType)
Checks if the specified string must be escaped before being used in HQL LIKE statements.
|
static String |
prepareDatabaseName(String dbName)
Removes all '[', ']' and '"' from the passed string.
|
static String |
replaceLast(String string,
String toReplace,
String replacement)
Replaces the substring toReplace with the string replacement in the given string at the last index of toReplace.
|
static String |
urlDecode(String toDecode)
Decodes a string for URL-usage unsing the
NgClientConstants.DEFAULT_ENCODING . |
static String |
urlEncode(String toEncode)
Encodes a string for URL-usage using the
NgClientConstants.DEFAULT_ENCODING . |
public static String prepareDatabaseName(String dbName)
dbName
- original database namepublic static String makeFolderClassName(String folderClassPath)
folderClassPath
- path stringpublic static String appendToFilename(String filename, String appendix)
filename
- The filename to be appended.appendix
- The appendix to append the given filename with.public static String escapeForJavaScript(String toEscape)
toEscape
- string to escapepublic static String escapeForHtml(String toEscape)
toEscape
- string to escapepublic static String replaceLast(String string, String toReplace, String replacement)
string
- the string to replace substring at last indextoReplace
- substring to replace at the last index in the stringreplacement
- replacement for the substring toReplace in the stringpublic static String urlEncode(String toEncode)
NgClientConstants.DEFAULT_ENCODING
.toEncode
- string to encodepublic static String urlDecode(String toDecode)
NgClientConstants.DEFAULT_ENCODING
.toDecode
- string to decodepublic static Set<Character> getHqlCharsToEscape(com.saperion.config.SQLType sqlType)
NgClientConstants.WEBCONFIG_HQL_CHARS_TO_ESCAPE
NgClientConstants.WEBCONFIG_HQL_CHARS_TO_ESCAPE_MSSQL
NgClientConstants.WEBCONFIG_HQL_CHARS_TO_ESCAPE_ORACLE
sqlType
- the database-type to escape the string forpublic static char getHqlEscapeCharacter()
NgClientConstants.WEBCONFIG_HQL_ESCAPE_CHARACTER
.public static String escapeStringForHql(String toEscape, com.saperion.config.SQLType sqlType)
getHqlEscapeCharacter()
and getHqlCharsToEscape(SQLType)
.toEscape
- the string to escapesqlType
- the type of SQL database in usepublic static boolean mustBeEscapedForHql(String toEscape, com.saperion.config.SQLType sqlType)
getHqlCharsToEscape(SQLType)
and getHqlEscapeCharacter()
for configuration.toEscape
- string to checksqlType
- the type of SQL database in useCopyright © 2021 Hyland Software Germany GmbH. All rights reserved.