public static String timeoutMessage(long timeout, TimeUnit unit) { return "The source did not signal an event for " + timeout + " " + unit.toString().toLowerCase() + " and has been terminated."; }
/** * Determine whether the given URL points to a jar file itself, * that is, has protocol "file" and ends with the ".jar" extension. * @param url the URL to check * @return whether the URL has been identified as a JAR file URL * @since 4.1 */ public static boolean isJarFileURL(URL url) { return (URL_PROTOCOL_FILE.equals(url.getProtocol()) && url.getPath().toLowerCase().endsWith(JAR_FILE_EXTENSION)); }
private int getPort(URI uri) { if (uri.getPort() == -1) { String scheme = uri.getScheme().toLowerCase(Locale.ENGLISH); return ("wss".equals(scheme) ? 443 : 80); } return uri.getPort(); }
public Challenge(String scheme, Map<String, String> authParams) { if (scheme == null) throw new NullPointerException("scheme == null"); if (authParams == null) throw new NullPointerException("authParams == null"); this.scheme = scheme; Map<String, String> newAuthParams = new LinkedHashMap<>(); for (Entry<String, String> authParam : authParams.entrySet()) { String key = (authParam.getKey() == null) ? null : authParam.getKey().toLowerCase(US); newAuthParams.put(key, authParam.getValue()); } this.authParams = unmodifiableMap(newAuthParams); }
@Override public String apply(String input) { return input.toLowerCase(); } });
private void updateContentTypeHeader() { if (this.contentType != null) { StringBuilder sb = new StringBuilder(this.contentType); if (!this.contentType.toLowerCase().contains(CHARSET_PREFIX) && this.charset) { sb.append(";").append(CHARSET_PREFIX).append(this.characterEncoding); } doAddHeaderValue(HttpHeaders.CONTENT_TYPE, sb.toString(), true); } }
private boolean isDisconnectedClientError(Throwable ex) { String message = NestedExceptionUtils.getMostSpecificCause(ex).getMessage(); message = (message != null ? message.toLowerCase() : ""); String className = ex.getClass().getSimpleName(); return (message.contains("broken pipe") || DISCONNECTED_CLIENT_EXCEPTIONS.contains(className)); }
private boolean indicatesDisconnectedClient(Throwable ex) { String message = NestedExceptionUtils.getMostSpecificCause(ex).getMessage(); message = (message != null ? message.toLowerCase() : ""); String className = ex.getClass().getSimpleName(); return (message.contains("broken pipe") || DISCONNECTED_CLIENT_EXCEPTIONS.contains(className)); }
/** * Convert the given key to a case-insensitive key. * <p>The default implementation converts the key * to lower-case according to this Map's Locale. * @param key the user-specified key * @return the key to use for storing * @see String#toLowerCase(Locale) */ protected String convertKey(String key) { return key.toLowerCase(getLocale()); }
@Override public int hashCode() { int result = (isCaseSensitiveName() ? this.name.hashCode() : this.name.toLowerCase().hashCode()); result = 31 * result + (this.value != null ? this.value.hashCode() : 0); result = 31 * result + (this.isNegated ? 1 : 0); return result; }
@Override public String apply(String t1) { return t1.trim().toLowerCase(); } };
@Override public String apply(String t1) { return t1.trim().toLowerCase(); } };
@Override public String[] resolve(Class<?> testClass) { return new String[] { testClass.getSimpleName().toLowerCase() }; } }
/** Returns true if {@code certificate} matches {@code hostname}. */ private boolean verifyHostname(String hostname, X509Certificate certificate) { hostname = hostname.toLowerCase(Locale.US); List<String> altNames = getSubjectAltNames(certificate, ALT_DNS_NAME); for (String altName : altNames) { if (verifyHostname(hostname, altName)) { return true; } } return false; }
private Token eatToken(TokenKind expectedKind) { Token t = nextToken(); if (t == null) { int pos = this.expressionString.length(); throw internalException(pos, SpelMessage.OOD); } if (t.kind != expectedKind) { throw internalException(t.startPos, SpelMessage.NOT_EXPECTED_TOKEN, expectedKind.toString().toLowerCase(), t.getKind().toString().toLowerCase()); } return t; }
File directoryOf(String baseClassName) throws Exception { File f = MaybeNo2Dot0Since.findSource("Flowable"); if (f == null) { return null; } String parent = f.getParentFile().getAbsolutePath().replace('\\', '/'); if (!parent.endsWith("/")) { parent += "/"; } parent += "internal/operators/" + baseClassName.toLowerCase() + "/"; return new File(parent); }
@Test public void test() { assertTrue(Arrays.asList(applicationContext.getEnvironment().getActiveProfiles()).contains( getClass().getSimpleName().toLowerCase())); }
private Method getMethodForHttpStatus(HttpStatus status) throws NoSuchMethodException { String name = status.name().toLowerCase().replace("_", "-"); name = "is" + StringUtils.capitalize(Conventions.attributeNameToPropertyName(name)); return StatusResultMatchers.class.getMethod(name); }
private void testTransportUrl(String scheme, String expectedScheme, TransportType transportType) throws Exception { SockJsUrlInfo info = new SockJsUrlInfo(new URI(scheme + "://example.com")); String serverId = info.getServerId(); String sessionId = info.getSessionId(); String transport = transportType.toString().toLowerCase(); URI expected = new URI(expectedScheme + "://example.com/" + serverId + "/" + sessionId + "/" + transport); assertThat(info.getTransportUrl(transportType), equalTo(expected)); }
@Test @EnabledOnMac void enabledIfWithSpelOsCheckInCustomComposedAnnotation() { String os = System.getProperty("os.name").toLowerCase(); assertTrue(os.contains("mac"), "This test must be enabled on Mac OS"); assertFalse(os.contains("win"), "This test must be disabled on Windows"); }