List of usage examples for org.apache.commons.lang3 StringUtils lowerCase
public static String lowerCase(final String str, final Locale locale)
Converts a String to lower case as per String#toLowerCase(Locale) .
A null input String returns null .
StringUtils.lowerCase(null, Locale.ENGLISH) = null StringUtils.lowerCase("", Locale.ENGLISH) = "" StringUtils.lowerCase("aBc", Locale.ENGLISH) = "abc"
From source file:com.github.albfernandez.joinpdf.JoinPdfFileFilter.java
public final boolean accept(final File pathname) { if (pathname == null) { return false; }//from w w w . j a va2 s . c o m String fileName = StringUtils.lowerCase(pathname.getName(), JoinPdf.LOCALE_ES); return fileName.endsWith("pdf") || fileName.endsWith("png") || fileName.endsWith("jpg") || fileName.endsWith("jpeg") || fileName.endsWith("tiff") || fileName.endsWith("tif"); }
From source file:com.nike.cerberus.validation.IamRolePermissionsValidator.java
private String buildKey(IamRolePermission iamRolePermission) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(StringUtils.lowerCase(iamRolePermission.getAccountId(), Locale.ENGLISH)); stringBuilder.append('-'); stringBuilder.append(StringUtils.lowerCase(iamRolePermission.getIamRoleName(), Locale.ENGLISH)); return stringBuilder.toString(); }
From source file:com.nike.cerberus.validation.IamPrincipalPermissionsValidator.java
private String buildKey(IamPrincipalPermission iamRolePermission) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(StringUtils.lowerCase(iamRolePermission.getIamPrincipalArn(), Locale.ENGLISH)); return stringBuilder.toString(); }
From source file:com.callidusrobotics.object.ItemData.java
public String getId() { return StringUtils.trim(StringUtils.lowerCase(identifier, Locale.ENGLISH)); }
From source file:ch.cyberduck.core.b2.B2AttributesFinderFeature.java
protected PathAttributes toAttributes(final B2FileResponse response) { final PathAttributes attributes = new PathAttributes(); attributes.setSize(response.getContentLength()); if (response.getFileInfo().containsKey(X_BZ_INFO_LARGE_FILE_SHA1)) { attributes.setChecksum(Checksum.parse(response.getFileInfo().get(X_BZ_INFO_LARGE_FILE_SHA1))); } else {//from w ww. java2 s.co m attributes.setChecksum(Checksum.parse(StringUtils .removeStart(StringUtils.lowerCase(response.getContentSha1(), Locale.ROOT), "unverified:"))); } final Map<String, String> metadata = new HashMap<>(); for (Map.Entry<String, String> entry : response.getFileInfo().entrySet()) { metadata.put(entry.getKey(), entry.getValue()); } attributes.setMetadata(metadata); attributes.setVersionId(response.getFileId()); if (response.getFileInfo().containsKey(X_BZ_INFO_SRC_LAST_MODIFIED_MILLIS)) { attributes.setModificationDate( Long.valueOf(response.getFileInfo().get(X_BZ_INFO_SRC_LAST_MODIFIED_MILLIS))); } return attributes; }
From source file:com.github.albfernandez.joinpdf.JoinPdf.java
private void add(final File file, final Document document, final PdfWriter writer) throws Exception { String fileName = StringUtils.lowerCase(file.getName(), LOCALE_ES); if (fileName.endsWith(".tif") || fileName.endsWith(".tiff")) { addTiff(file, document, writer); } else if (fileName.endsWith(".pdf")) { addPdf(file, document, writer);//from ww w . j ava 2 s.co m } else { addImage(file, document, writer); } }
From source file:ch.cyberduck.core.b2.B2ObjectListService.java
/** * @param response List filenames response from server * @return Null when respone filename is not child of working directory directory */// w ww . j a v a 2s.c o m protected PathAttributes parse(final B2FileInfoResponse response) { final PathAttributes attributes = new PathAttributes(); attributes.setChecksum(Checksum.parse(StringUtils .removeStart(StringUtils.lowerCase(response.getContentSha1(), Locale.ROOT), "unverified:"))); final long timestamp = response.getUploadTimestamp(); if (response.getFileInfo().containsKey(X_BZ_INFO_SRC_LAST_MODIFIED_MILLIS)) { attributes.setModificationDate( Long.valueOf(response.getFileInfo().get(X_BZ_INFO_SRC_LAST_MODIFIED_MILLIS))); } else { attributes.setModificationDate(timestamp); } attributes.setVersionId(response.getFileId()); switch (response.getAction()) { case hide: // File version marking the file as hidden, so that it will not show up in b2_list_file_names case start: // Large file has been started, but not finished or canceled attributes.setDuplicate(true); attributes.setSize(-1L); break; default: attributes.setSize(response.getSize()); } return attributes; }
From source file:com.github.albfernandez.joinpdf.JoinPdf.java
private int getPageCount(final File file) throws IOException { String fileName = StringUtils.lowerCase(file.getName(), LOCALE_ES); if (fileName.endsWith(".tif") || fileName.endsWith(".tiff")) { return getPageCountTif(file); }/* www . java 2 s . c o m*/ if (fileName.endsWith(".pdf")) { return getPageCountPdf(file); } return 1; }
From source file:at.bitfire.davdroid.resource.LocalAddressBook.java
protected static String xNameToLabel(String xname) { // "X-MY_PROPERTY" // 1. ensure lower case -> "x-my_property" // 2. remove x- from beginning -> "my_property" // 3. replace "_" by " " -> "my property" // 4. capitalize -> "My Property" String lowerCase = StringUtils.lowerCase(xname, Locale.US), withoutPrefix = StringUtils.removeStart(lowerCase, "x-"), withSpaces = StringUtils.replace(withoutPrefix, "_", " "); return StringUtils.capitalize(withSpaces); }
From source file:org.graylog.plugins.pipelineprocessor.functions.strings.Lowercase.java
@Override protected String apply(String value, Locale locale) { return StringUtils.lowerCase(value, locale); }