/** * Converts all of the characters in the string to upper case. * * @param s the string to convert * @return the string, converted to upper-case, or <code>null</code> if the * string is <code>null</code> * @see String#toUpperCase() */ public static String upperCase(String s) { return toUpperCase(s); }
/** * Converts all of the characters in the string to upper case, based on the * portal instance's default locale. * * @param s the string to convert * @return the string, converted to upper case, or <code>null</code> if the * string is <code>null</code> */ public static String toUpperCase(String s) { return toUpperCase(s, null); }
public java.lang.String toUpperCase(java.lang.String s, java.util.Locale locale) { return StringUtil.toUpperCase(s, locale); }
public java.lang.String toUpperCase(java.lang.String s) { return StringUtil.toUpperCase(s); }
@Override public int compareTo(VersionableName versionableName) { String upperCaseName = StringUtil.toUpperCase(_name); return upperCaseName.compareTo( StringUtil.toUpperCase(versionableName.getName())); }
private String _getShortDisplayName( Locale locale, Set<String> duplicateLanguages) { String language = locale.getDisplayLanguage(locale); if (language.length() > 3) { language = locale.getLanguage(); language = StringUtil.toUpperCase(language); } String country = locale.getCountry(); return _getDisplayName( language, StringUtil.toUpperCase(country), locale, duplicateLanguages); }
private static String _formatG(String s) { if (Character.isLowerCase(s.charAt(0))) { s = StringUtil.toUpperCase( s.substring(0, 1) ).concat( s.substring(1) ); } return s; }
private static String _get( HttpServletRequest request, String name, boolean toUpperCase) { Map<String, Cookie> cookieMap = _getCookieMap(request); if (toUpperCase) { name = StringUtil.toUpperCase(name); } Cookie cookie = cookieMap.get(name); if (cookie == null) { return null; } return cookie.getValue(); }
public boolean isAscending() { String orderBy = StringUtil.toUpperCase(getOrderBy()); if ((orderBy == null) || orderBy.endsWith(_ORDER_BY_DESC)) { return false; } return true; }
private static String _formatA(String s) { return StringUtil.replace( StringUtil.toUpperCase(s), CharPool.SPACE, CharPool.UNDERLINE); }
private static Type _getType(String name) { name = StringUtil.toUpperCase(name); for (Type type : values()) { if (name.equals(type.name())) { return type; } } return Type.STRING; }
private static Map<String, Cookie> _getCookieMap( HttpServletRequest request) { Map<String, Cookie> cookieMap = (Map<String, Cookie>)request.getAttribute( CookieKeys.class.getName()); if (cookieMap != null) { return cookieMap; } Cookie[] cookies = request.getCookies(); if (cookies == null) { cookieMap = new HashMap<>(); } else { cookieMap = new HashMap<>(cookies.length * 4 / 3); for (Cookie cookie : cookies) { String cookieName = GetterUtil.getString(cookie.getName()); cookieName = StringUtil.toUpperCase(cookieName); cookieMap.put(cookieName, cookie); } } request.setAttribute(CookieKeys.class.getName(), cookieMap); return cookieMap; }
public static void deleteCookies( HttpServletRequest request, HttpServletResponse response, String domain, String... cookieNames) { if (!_SESSION_ENABLE_PERSISTENT_COOKIES) { return; } Map<String, Cookie> cookieMap = _getCookieMap(request); for (String cookieName : cookieNames) { Cookie cookie = cookieMap.remove( StringUtil.toUpperCase(cookieName)); if (cookie != null) { if (domain != null) { cookie.setDomain(domain); } cookie.setMaxAge(0); cookie.setPath(StringPool.SLASH); cookie.setValue(StringPool.BLANK); response.addCookie(cookie); } } }
protected static String getDayOfWeek(DayAndPosition dayPos) { Calendar calendar = CalendarFactoryUtil.getCalendar(); calendar.set(Calendar.DAY_OF_WEEK, dayPos.getDayOfWeek()); Format format = FastDateFormatFactoryUtil.getSimpleDateFormat( "EEE", LocaleUtil.US); return StringUtil.toUpperCase(format.format(calendar)); }
public String normalizeName(String name, DatabaseMetaData databaseMetaData) throws SQLException { if (databaseMetaData.storesLowerCaseIdentifiers()) { return StringUtil.toLowerCase(name); } if (databaseMetaData.storesUpperCaseIdentifiers()) { return StringUtil.toUpperCase(name); } return name; }
/** * @deprecated As of Judson (7.1.x), with no direct replacement */ @Deprecated public static void init(String serverId) { ServerType serverType = null; try { serverType = ServerType.valueOf(StringUtil.toUpperCase(serverId)); } catch (IllegalArgumentException iae) { serverType = _detectServerType(); } try { Field field = ReflectionUtil.getDeclaredField( ServerDetector.class, "_serverType"); field.set(null, serverType); } catch (Exception e) { ReflectionUtil.throwException(e); } }
if (password.equals(StringUtil.toUpperCase(password))) { continue;
public static void addCookie( HttpServletRequest request, HttpServletResponse response, Cookie cookie, boolean secure) { if (!_SESSION_ENABLE_PERSISTENT_COOKIES) { return; } // LEP-5175 String name = cookie.getName(); String originalValue = cookie.getValue(); String encodedValue = originalValue; if (isEncodedCookie(name)) { encodedValue = UnicodeFormatter.bytesToHex( originalValue.getBytes()); if (_log.isDebugEnabled()) { _log.debug("Add encoded cookie " + name); _log.debug("Original value " + originalValue); _log.debug("Hex encoded value " + encodedValue); } } cookie.setSecure(secure); cookie.setValue(encodedValue); cookie.setVersion(0); response.addCookie(cookie); Map<String, Cookie> cookieMap = _getCookieMap(request); cookieMap.put(StringUtil.toUpperCase(name), cookie); }
public static IndexMetadata createIndexMetadata( boolean unique, String tableName, String... columnNames) { if (columnNames == null) { throw new NullPointerException("Column names are missing"); } StringBundler sb = new StringBundler(4 + columnNames.length * 2); sb.append(tableName); sb.append(StringPool.SPACE); sb.append(StringPool.OPEN_PARENTHESIS); for (String columnName : columnNames) { sb.append(columnName); sb.append(StringPool.COMMA_AND_SPACE); } sb.setIndex(sb.index() - 1); sb.append(StringPool.CLOSE_PARENTHESIS); sb.append(StringPool.SEMICOLON); String specification = sb.toString(); String specificationHash = StringUtil.toHexString( specification.hashCode()); specificationHash = StringUtil.toUpperCase(specificationHash); return new IndexMetadata( _INDEX_NAME_PREFIX.concat(specificationHash), tableName, unique, columnNames); }
return ServerType.valueOf(StringUtil.toUpperCase(serverId));