List of usage examples for org.apache.commons.lang3 StringUtils upperCase
public static String upperCase(final String str)
Converts a String to upper case as per String#toUpperCase() .
A null input String returns null .
StringUtils.upperCase(null) = null StringUtils.upperCase("") = "" StringUtils.upperCase("aBc") = "ABC"
Note: As described in the documentation for String#toUpperCase() , the result of this method is affected by the current locale.
From source file:ch.cyberduck.core.irods.IRODSProtocol.java
@Override public String getPrefix() { return String.format("%s.%s", IRODSProtocol.class.getPackage().getName(), StringUtils.upperCase(this.getType().name())); }
From source file:io.wcm.caravan.io.http.impl.RequestUtil.java
/** * @param urlPrefix URL prefix//from www . ja va 2 s .co m * @param request Requset * @return HTTP client request object */ public static HttpUriRequest buildHttpRequest(String urlPrefix, Request request) { String url = urlPrefix + request.url(); // http method HttpUriRequest httpRequest; String method = StringUtils.upperCase(request.method()); switch (method) { case HttpGet.METHOD_NAME: httpRequest = new HttpGet(url); break; case HttpPost.METHOD_NAME: httpRequest = new HttpPost(url); break; case HttpPut.METHOD_NAME: httpRequest = new HttpPut(url); break; case HttpDelete.METHOD_NAME: httpRequest = new HttpDelete(url); break; default: throw new IllegalArgumentException("Unsupported HTTP method type: " + request.method()); } // headers for (Entry<String, Collection<String>> entry : request.headers().entrySet()) { Streams.of(entry.getValue()).forEach(value -> httpRequest.addHeader(entry.getKey(), value)); } // body if ((httpRequest instanceof HttpEntityEnclosingRequest) && request.body() != null) { HttpEntityEnclosingRequest entityHttpRequest = (HttpEntityEnclosingRequest) httpRequest; if (request.charset() != null) { entityHttpRequest.setEntity( new StringEntity(new String(request.body(), request.charset()), request.charset())); } else { entityHttpRequest.setEntity(new ByteArrayEntity(request.body())); } } return httpRequest; }
From source file:io.dockstore.provision.ICGCGetPlugin.java
@Override public void start() { // for testing the development mode if (RuntimeMode.DEVELOPMENT.equals(wrapper.getRuntimeMode())) { System.out.println(StringUtils.upperCase("ICGCStorageClientPlugin development mode")); }//w ww .j av a 2s . com }
From source file:org.meruvian.yama.webapi.service.RestRoleService.java
@Override @Transactional/*from w w w . j a va 2 s . c o m*/ public Role saveRole(Role role) { if (StringUtils.isBlank(role.getId())) { role.setId(null); role.setName(StringUtils.upperCase(role.getName())); return roleRepository.save(role); } throw new BadRequestException("Id must be empty, use PUT method to update record"); }
From source file:ch.cyberduck.ui.browser.PathTooltipService.java
public String getTooltip(final Path file) { final StringBuilder tooltip = new StringBuilder(file.getAbsolute()); if (StringUtils.isNotBlank(file.attributes().getRegion())) { tooltip.append("\n").append(file.attributes().getRegion()); }/*from w w w . j av a2 s .c om*/ final Checksum checksum = file.attributes().getChecksum(); if (Checksum.NONE != checksum) { tooltip.append("\n").append( String.format("%s %s", StringUtils.upperCase(checksum.algorithm.name()), checksum.hash)); } if (StringUtils.isNotBlank(file.attributes().getVersionId())) { tooltip.append("\n").append(file.attributes().getVersionId()); } tooltip.append("\n").append(sizeFormatter.format(file.attributes().getSize())); tooltip.append("\n").append(dateFormatter.getLongFormat(file.attributes().getModificationDate())); return tooltip.toString(); }
From source file:ch.cyberduck.core.sds.SDSProtocol.java
@Override public String getPrefix() { return String.format("%s.%s", SDSProtocol.class.getPackage().getName(), StringUtils.upperCase("sds")); }
From source file:$.SessionCredentialInterceptor.java
@Override public String intercept(ActionInvocation invocation) throws Exception { ValueStack stack = invocation.getStack(); stack.set("currentUser", sessionCredential.getCurrentUser()); stack.set("adminRole", adminRole); List<String> roles = sessionCredential.getCurrentRoles(); boolean isAdmin = roles.contains(StringUtils.upperCase(adminRole)); stack.set("currentRoles", roles); stack.set("isAdmin", isAdmin); return invocation.invoke(); }//from w w w .ja v a 2 s . c o m
From source file:ch.cyberduck.core.proxy.SystemConfigurationProxy.java
@Override public Proxy find(final Host target) { if (!preferences.getBoolean("connection.proxy.enable")) { return Proxy.DIRECT; }//from www .j av a 2 s . co m final String route = this.findNative(provider.get(target)); if (null == route) { if (log.isInfoEnabled()) { log.info(String.format("No poxy configuration found for target %s", target)); } // Direct return Proxy.DIRECT; } final URI proxy; try { proxy = new URI(route); try { return new Proxy(Proxy.Type.valueOf(StringUtils.upperCase(proxy.getScheme())), proxy.getHost(), proxy.getPort()); } catch (IllegalArgumentException e) { log.warn(String.format("Unsupported scheme for proxy %s", proxy)); } } catch (URISyntaxException e) { log.warn(String.format("Invalid proxy configuration %s", route)); } return Proxy.DIRECT; }
From source file:org.meruvian.yama.webapi.service.RestRoleService.java
@Override @Transactional/*from w w w. j a va2s. c om*/ public Role updateRole(Role role) { Role r = roleRepository.findById(role.getId()); r.setName(StringUtils.upperCase(role.getName())); r.setDescription(role.getDescription()); return r; }
From source file:edu.emory.bmi.aiw.i2b2export.output.PatientDataRowOutputFormatter.java
@Override protected Collection<Observation> matchingObservations(I2b2ConceptEntity i2b2Concept) throws SQLException { switch (StringUtils.upperCase(i2b2Concept.getTableName())) { case "CONCEPT_DIMENSION": List<Observation> obxs = this.keyToObx.get(i2b2Concept.getI2b2Key()); if (obxs != null) { return Collections.unmodifiableCollection(obxs); } else {// w w w . j av a 2s . c o m return Collections.emptyList(); } case "PATIENT_DIMENSION": if (compareDimensionColumnValue(i2b2Concept, patient)) { Observation.Builder b = new Observation.Builder(null).tval(getParam(patient, i2b2Concept)); Collection<Observation> o = Collections.singleton(b.build()); return o; } else { return Collections.emptyList(); } default: return Collections.emptyList(); } }