本文整理汇总了Java中org.apache.commons.lang.StringUtils.lowerCase方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.lowerCase方法的具体用法?Java StringUtils.lowerCase怎么用?Java StringUtils.lowerCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang.StringUtils
的用法示例。
在下文中一共展示了StringUtils.lowerCase方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setOrderDir
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
* 设置排序方式向.
*
* @param orderDir
* 可选值为desc或asc,多个排序字段时用','分隔.
*/
public void setOrderDir(final String orderDir) {
String lowcaseOrderDir = StringUtils.lowerCase(orderDir);
// 检查order字符串的合法值
String[] orderDirs = StringUtils.split(lowcaseOrderDir, ',');
for (String orderDirStr : orderDirs) {
if (!StringUtils.equals(Sort.DESC, orderDirStr)
&& !StringUtils.equals(Sort.ASC, orderDirStr)) {
throw new IllegalArgumentException("排序方向" + orderDirStr
+ "不是合法值");
}
}
this.orderDir = lowcaseOrderDir;
}
示例2: handlePost
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@RequestMapping(method = RequestMethod.POST)
protected String handlePost(RedirectAttributes redirectAttributes,
HttpServletRequest request
) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
try {
if (ServletFileUpload.isMultipartContent(request)) {
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
List<?> items = upload.parseRequest(request);
for (Object o : items) {
FileItem item = (FileItem) o;
if ("file".equals(item.getFieldName()) && !StringUtils.isBlank(item.getName())) {
if (item.getSize() > MAX_PLAYLIST_SIZE_MB * 1024L * 1024L) {
throw new Exception("The playlist file is too large. Max file size is " + MAX_PLAYLIST_SIZE_MB + " MB.");
}
String playlistName = FilenameUtils.getBaseName(item.getName());
String fileName = FilenameUtils.getName(item.getName());
String format = StringUtils.lowerCase(FilenameUtils.getExtension(item.getName()));
String username = securityService.getCurrentUsername(request);
Playlist playlist = playlistService.importPlaylist(username, playlistName, fileName,
item.getInputStream(), null);
map.put("playlist", playlist);
}
}
}
} catch (Exception e) {
map.put("error", e.getMessage());
}
redirectAttributes.addFlashAttribute("model", map);
return "redirect:importPlaylist";
}
示例3: getDefaultJobName
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public static String getDefaultJobName(Object obj) {
String className;
if (obj instanceof JobCommand) {
return ((JobCommand) obj).getJobName();
} else if (obj instanceof Class) {
className = ((Class) obj).getSimpleName();
} else if (obj instanceof String) {
className = (String) obj;
} else {
className = obj.getClass().getSimpleName();
}
return StringUtils.lowerCase(StringUtils.substring(className, 0, 1))
+ StringUtils.substring(className, 1);
}
示例4: getJobName
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public String getJobName() {
if (StringUtils.isNotEmpty(this.jobName)) {
return this.jobName;
} else {
String className = this.getClass().getSimpleName();
return StringUtils.lowerCase(StringUtils.substring(className, 0, 1))
+ StringUtils.substring(className, 1);
}
}
示例5: setOrder
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
* 设置排序方式向.
*
* @param order 可选值为desc或asc,多个排序字段时用','分隔.
*/
public void setOrder(final String order) {
//检查order字符串的合法值
String[] orders = StringUtils.split(StringUtils.lowerCase(order), ',');
for (String orderStr : orders) {
if (!StringUtils.equals(DESC, orderStr) && !StringUtils.equals(ASC, orderStr)) {
throw new IllegalArgumentException("排序方向" + orderStr + "不是合法值");
}
}
this.order = StringUtils.lowerCase(order);
}
示例6: sanitizeExtension
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
static String sanitizeExtension(String suffix) {
return StringUtils.lowerCase(StringUtils.removeStart(suffix, "."));
}