List of usage examples for org.apache.commons.lang StringUtils upperCase
public static String upperCase(String str)
Converts a String to upper case as per String#toUpperCase() .
From source file:org.sonar.core.permission.PermissionQuery.java
private String searchToSql(@Nullable String s) { String sql = null;//from w w w.jav a2 s .c om if (s != null) { sql = StringUtils.replace(StringUtils.upperCase(s), "%", "/%"); sql = StringUtils.replace(sql, "_", "/_"); sql = "%" + sql + "%"; } return sql; }
From source file:org.sonar.core.persistence.dialect.OracleSequenceGenerator.java
@Override public void configure(Type type, Properties params, Dialect dialect) { String tableName = params.getProperty(PersistentIdentifierGenerator.TABLE); if (tableName != null) { StringBuilder sequenceNameBuilder = new StringBuilder(); sequenceNameBuilder.append(tableName); sequenceNameBuilder.append(SEQUENCE_NAME_SUFFIX); params.setProperty(SEQUENCE, StringUtils.upperCase(sequenceNameBuilder.toString())); }/*from w w w . j av a 2 s . co m*/ super.configure(type, params, dialect); }
From source file:org.sonar.core.user.GroupMembershipQuery.java
private String groupSearchToSql(@Nullable String s) { String sql = null;// www .ja va 2 s . com if (s != null) { sql = StringUtils.replace(StringUtils.upperCase(s), "%", "/%"); sql = StringUtils.replace(sql, "_", "/_"); sql = "%" + sql + "%"; } return sql; }
From source file:org.sonar.core.user.UserMembershipQuery.java
private String memberSearchToSql(@Nullable String s) { String sql = null;/*from ww w .j a v a 2 s. c o m*/ if (s != null) { sql = StringUtils.replace(StringUtils.upperCase(s), "%", "/%"); sql = StringUtils.replace(sql, "_", "/_"); sql = "%" + sql + "%"; } return sql; }
From source file:org.sonar.db.permission.OldPermissionQuery.java
private static String searchToSql(@Nullable String s) { String sql = null;//from w ww. j av a 2 s. c o m if (s != null) { sql = StringUtils.replace(StringUtils.upperCase(s), "%", "/%"); sql = StringUtils.replace(sql, "_", "/_"); sql = "%" + sql + "%"; } return sql; }
From source file:org.sonar.db.user.GroupMembershipQuery.java
private static String groupSearchToSql(@Nullable String s) { String sql = null;//from www . ja v a 2 s. c o m if (s != null) { sql = StringUtils.replace(StringUtils.upperCase(s), "%", "/%"); sql = StringUtils.replace(sql, "_", "/_"); sql = "%" + sql + "%"; } return sql; }
From source file:org.sonar.server.filters.FilterExecutor.java
private void setHqlParameters(Filter filter, Query query) { query.setParameter("status", Snapshot.STATUS_PROCESSED); query.setParameter("islast", true); if (filter.hasScopes()) { query.setParameter("scopes", filter.getScopes()); }//from w w w.ja v a 2 s . c o m if (filter.hasQualifiers()) { query.setParameter("qualifiers", filter.getQualifiers()); } if (filter.hasLanguages()) { query.setParameter("languages", filter.getLanguages()); } if (filter.hasFavouriteIds()) { query.setParameter("favourites", filter.getFavouriteIds()); } if (filter.getDateCriterion() != null) { query.setParameter("date", filter.getDateCriterion().getDate()); } if (filter.hasBaseSnapshot()) { query.setParameter("root_sid", filter.getRootSnapshotId()); query.setParameter("path", new StringBuilder().append(filter.getBaseSnapshotPath()) .append(filter.getBaseSnapshotId()).append(".%").toString()); } if (StringUtils.isNotBlank(filter.getKeyRegexp())) { query.setParameter("kee", StringUtils.upperCase(StringUtils.replaceChars(filter.getKeyRegexp(), '*', '%'))); } if (StringUtils.isNotBlank(filter.getNameRegexp())) { query.setParameter("name", StringUtils.upperCase(StringUtils.replaceChars(filter.getNameRegexp(), '*', '%'))); } }
From source file:org.sonar.server.measure.MeasureFilterSql.java
private void appendResourceKeyCondition(StringBuilder sb) { if (StringUtils.isNotBlank(filter.getResourceKey())) { sb.append(" and UPPER(c.kee) like '%"); sb.append(escapePercentAndUnderscrore( StringEscapeUtils.escapeSql(StringUtils.upperCase(filter.getResourceKey())))); sb.append("%'"); appendEscapeForSomeDb(sb);//ww w .j ava2 s.c om } }
From source file:org.sonar.server.user.db.GroupDao.java
private String groupSearchToSql(@Nullable String query) { String sql = SQL_WILDCARD;//from ww w .j a v a2s . com if (query != null) { sql = StringUtils.replace(StringUtils.upperCase(query), SQL_WILDCARD, "/%"); sql = StringUtils.replace(sql, "_", "/_"); sql = SQL_WILDCARD + sql + SQL_WILDCARD; } return sql; }
From source file:org.springframework.ldap.core.LdapRdnComponent.java
/** * Constructs an LdapRdnComponent, optionally decoding the value. * <p>// w ww .j av a2s . c o m * Depending on the value of the "key case fold" System property, the keys * will be lowercased, uppercased, or preserve their original case. Default * is to convert them to lowercase. * * @param key the Attribute name. * @param value the Attribute value. * @param decodeValue if <code>true</code> the value is decoded (typically * used when a DN is parsed from a String), otherwise the value is used as * specified. * @see DistinguishedName#KEY_CASE_FOLD_PROPERTY */ public LdapRdnComponent(String key, String value, boolean decodeValue) { Validate.notEmpty(key, "Key must not be empty"); Validate.notEmpty(value, "Value must not be empty"); String caseFold = System.getProperty(DistinguishedName.KEY_CASE_FOLD_PROPERTY); if (StringUtils.isBlank(caseFold) || caseFold.equals(DistinguishedName.KEY_CASE_FOLD_LOWER)) { this.key = StringUtils.lowerCase(key); } else if (caseFold.equals(DistinguishedName.KEY_CASE_FOLD_UPPER)) { this.key = StringUtils.upperCase(key); } else if (caseFold.equals(DistinguishedName.KEY_CASE_FOLD_NONE)) { this.key = key; } else { log.warn("\"" + caseFold + "\" invalid property value for " + DistinguishedName.KEY_CASE_FOLD_PROPERTY + "; expected \"" + DistinguishedName.KEY_CASE_FOLD_LOWER + "\", \"" + DistinguishedName.KEY_CASE_FOLD_UPPER + "\", or \"" + DistinguishedName.KEY_CASE_FOLD_NONE + "\""); this.key = StringUtils.lowerCase(key); } if (decodeValue) { this.value = LdapEncoder.nameDecode(value); } else { this.value = value; } }