本文整理匯總了Java中org.apache.commons.lang3.StringUtils.endsWithIgnoreCase方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtils.endsWithIgnoreCase方法的具體用法?Java StringUtils.endsWithIgnoreCase怎麽用?Java StringUtils.endsWithIgnoreCase使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.lang3.StringUtils
的用法示例。
在下文中一共展示了StringUtils.endsWithIgnoreCase方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRelationTableNames
import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
public List<String> getRelationTableNames(String table) {
List<String> result = new ArrayList<String>();
String sql = "SELECT name FROM sqlite_master WHERE type='table' AND (name LIKE '" + table + "#_%' OR name LIKE '%#_" + table +"' ESCAPE '#')";
Cursor c = getCursor(sql);
while(c.moveToNext()) {
String name = c.getString(c.getColumnIndexOrThrow("name"));
if(!name.equalsIgnoreCase(table) && (
StringUtils.startsWithIgnoreCase(name, table) ||
StringUtils.endsWithIgnoreCase(name, table)
)) {
result.add(name);
}
}
close(c);
return result;
}
示例2: getNumberOfDays
import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
private static BigDecimal getNumberOfDays(String expiry) {
if (StringUtils.endsWithIgnoreCase(expiry, TENOR_SUFFIX_YEARS)) {
return DAYS_IN_YEAR.multiply(new BigDecimal(StringUtils.replaceIgnoreCase(expiry, TENOR_SUFFIX_YEARS, StringUtils.EMPTY)));
} else if (StringUtils.endsWithIgnoreCase(expiry, TENOR_SUFFIX_MONTHS)) {
return DAYS_PER_MONTH.multiply(new BigDecimal(StringUtils.replaceIgnoreCase(expiry, TENOR_SUFFIX_MONTHS, StringUtils.EMPTY)));
} else {
return DAYS_IN_WEEK.multiply(new BigDecimal(StringUtils.replaceIgnoreCase(expiry, TENOR_SUFFIX_WEEKS, StringUtils.EMPTY)));
}
}
示例3: rmXSS
import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
private String rmXSS(String script) {// 移除存在XSS攻擊威脅的字符串
if (StringUtils.isBlank(script)) {
return script;
}
Pattern p = Pattern.compile("<root>.+</root>");// 例外處理
Matcher m = p.matcher(script);
if (m.find()) {
return script;
}
if (StringUtils.endsWithIgnoreCase(script, "\56jsp")) {// 例外處理
return script;
}
if (StringUtils.isNotEmpty(StringUtils.substringBetween(script, "【", "】"))) {// 例外處理
return script;
}
script = rmXSSBetween(script, "<", ">");
script = rmXSSBetween(script, "\"", "\"");
script = rmXSSBetween(script, "'", "'");
script = rmXSSBetween(script, "<", ">");
script = rmXSSBetween(script, "<", ">");
script = rmXSSBetween(script, "<", ">");
script = rmXSSBetween(script, "(", ")");
script = rmXSSDangerousCharacters(script, DANGEROUS_CHARACTERS);
script = rmXSSDangerousCharacters(CHARACTERS_DANGEROUS, script);
String[] temp = StringUtils.split(script);
if (null != temp && temp.length > 0) {
return temp[0];
}
return script;
}
示例4: isUrlMatchingEntity
import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
public boolean isUrlMatchingEntity(String entity) {
boolean isLast = StringUtils.endsWithIgnoreCase(url, RedirectorConstants.DELIMETER + entity);
boolean isInTheMiddle = StringUtils.containsIgnoreCase(url, RedirectorConstants.DELIMETER + entity + RedirectorConstants.DELIMETER);
boolean isLastBeforeQueryParam = StringUtils.containsIgnoreCase(url, RedirectorConstants.DELIMETER + entity + QUERY_PARAM_START);
return isLast || isInTheMiddle || isLastBeforeQueryParam;
}
示例5: handle
import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
@Override
protected boolean handle(String input, String searchString, boolean ignoreCase) {
if (ignoreCase) {
return StringUtils.endsWithIgnoreCase(input, searchString);
} else {
return StringUtils.endsWith(input, searchString);
}
}
示例6: filterSensitiveConfiguration
import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
public static Configuration filterSensitiveConfiguration(Configuration configuration){
Set<String> keys = configuration.getKeys();
for (final String key : keys) {
boolean isSensitive = StringUtils.endsWithIgnoreCase(key, "password")
|| StringUtils.endsWithIgnoreCase(key, "accessKey");
if (isSensitive && configuration.get(key) instanceof String) {
configuration.set(key, configuration.getString(key).replaceAll(".", "*"));
}
}
return configuration;
}
示例7: getHttpRequest
import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
private static HttpRequest getHttpRequest(String url, Object data, String method) throws IOException {
if (StringUtils.endsWithIgnoreCase(method, HttpMethods.GET)) {
return requestFactory.buildGetRequest(new GenericUrl(url + genParamGet(data)));
} else {
Map<String, Object> paramMap = genParamMap(data);
UrlEncodedContent urlEncodedContent = new UrlEncodedContent(paramMap);
return requestFactory.buildRequest(method, new GenericUrl(url), urlEncodedContent);
}
}