本文整理汇总了Java中org.apache.commons.lang.StringUtils.endsWithIgnoreCase方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.endsWithIgnoreCase方法的具体用法?Java StringUtils.endsWithIgnoreCase怎么用?Java StringUtils.endsWithIgnoreCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang.StringUtils
的用法示例。
在下文中一共展示了StringUtils.endsWithIgnoreCase方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validatePage
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
protected boolean validatePage() {
boolean returnCode= super.validatePage() && validateFilename();
if(returnCode){
IPath iPath=new Path(getContainerFullPath()+JOBS_FOLDER_NAME);
IFolder folder=ResourcesPlugin.getWorkspace().getRoot().getFolder(iPath);
if(!StringUtils.endsWithIgnoreCase(getFileName(), Constants.JOB_EXTENSION)){
IFile newFile= folder.getFile(getFileName()+Constants.JOB_EXTENSION);
if(newFile.exists()){
setErrorMessage("'"+newFile.getName()+"'"+Constants.ALREADY_EXISTS);
return false;
}
}
}
return returnCode;
}
示例2: accept
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@Override
public boolean accept(File file) {
if (file.isDirectory()) {
return true;
} else {
String fileName = file.getName();
if(null != removeSoFiles && removeSoFiles.size() > 0){
if(removeSoFiles.contains(fileName)){
return false;
}
}
String path = file.getAbsolutePath();
boolean isSupportAbi = false;
if(null != supportAbis && supportAbis.size() > 0) {
for (String supportAbi : supportAbis) {
String abi = File.separator + supportAbi + File.separator + fileName;
if (path.indexOf(abi) > 0) {
isSupportAbi = true;
break;
}
}
}else{
isSupportAbi=true;
}
if (isSupportAbi
&& (StringUtils.endsWithIgnoreCase(fileName, ".so") || "gdbserver".equalsIgnoreCase(fileName))) {
return true;
}
}
return false;
}
示例3: isImageFile
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private static boolean isImageFile(String name) {
for (String imgExt : IMG_EXTENSIONS) {
if (StringUtils.endsWithIgnoreCase(name, imgExt)) {
return true;
}
}
return false;
}
示例4: inject
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
* The injection of code for the specified jar package
*
* @param inJar
* @param outJar
* @throws IOException
* @throws NotFoundException
* @throws CannotCompileException
*/
public static List<String> inject(ClassPool pool,
File inJar,
File outJar,
InjectParam injectParam) throws Exception {
List<String> errorFiles = new ArrayList<String>();
JarFile jarFile = newJarFile(inJar);
outJar.getParentFile().mkdirs();
FileOutputStream fileOutputStream = new FileOutputStream(outJar);
JarOutputStream jos = new JarOutputStream(new BufferedOutputStream(fileOutputStream));
Enumeration<JarEntry> jarFileEntries = jarFile.entries();
JarEntry jarEntry = null;
while (jarFileEntries.hasMoreElements()) {
jarEntry = jarFileEntries.nextElement();
String name = jarEntry.getName();
String className = StringUtils.replace(name, File.separator, "/");
className = StringUtils.replace(className, "/", ".");
className = StringUtils.substring(className, 0, className.length() - 6);
if (!StringUtils.endsWithIgnoreCase(name, ".class")) {
InputStream inputStream = jarFile.getInputStream(jarEntry);
copyStreamToJar(inputStream, jos, name, jarEntry.getTime(), jarEntry);
IOUtils.closeQuietly(inputStream);
} else {
byte[] codes;
codes = inject(pool, className, injectParam);
InputStream classInstream = new ByteArrayInputStream(codes);
copyStreamToJar(classInstream, jos, name, jarEntry.getTime(), jarEntry);
}
}
jarFile.close();
IOUtils.closeQuietly(jos);
return errorFiles;
}
示例5: execute
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public void execute(@Param("nid") Long nid, @Param("command") String command, @Param("value") String value) {
try {
if (StringUtils.equalsIgnoreCase(command, OFFLINE)) {
List<Channel> channels = channelService.listByNodeId(nid, ChannelStatus.START);
for (Channel channel : channels) {// 重启一下对应的channel
boolean result = arbitrateManageService.channelEvent().restart(channel.getId());
if (result) {
channelService.notifyChannel(channel.getId());// 推送一下配置
}
}
} else if (StringUtils.equalsIgnoreCase(command, ONLINE)) {
// doNothing,自动会加入服务列表
} else if (StringUtils.endsWithIgnoreCase(command, THREAD)) {
nodeRemoteService.setThreadPoolSize(nid, Integer.valueOf(value));
} else if (StringUtils.endsWithIgnoreCase(command, PROFILE)) {
nodeRemoteService.setProfile(nid, BooleanUtils.toBoolean(value));
} else {
returnError("please add specfy the 'command' param.");
return;
}
returnSuccess();
} catch (Exception e) {
String errorMsg = String.format("error happens while [%s] with node id [%d]", command, nid);
log.error(errorMsg, e);
returnError(errorMsg);
}
}
示例6: importParamterFileToProject
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private boolean importParamterFileToProject(String[] listOfFilesToBeImported, String source,String destination, ParamterFileTypes paramterFileTypes) {
for (String fileName : listOfFilesToBeImported) {
String absoluteFileName = source + fileName;
IPath destinationIPath=new Path(destination);
destinationIPath=destinationIPath.append(fileName);
File destinationFile=destinationIPath.toFile();
try {
if (!ifDuplicate(listOfFilesToBeImported, paramterFileTypes)) {
if (StringUtils.equalsIgnoreCase(absoluteFileName, destinationFile.toString())) {
return true;
} else if (destinationFile.exists()) {
int returnCode = doUserConfirmsToOverRide();
if (returnCode == SWT.YES) {
FileUtils.copyFileToDirectory(new File(absoluteFileName), new File(destination));
} else if (returnCode == SWT.NO) {
return true;
} else {
return false;
}
} else {
FileUtils.copyFileToDirectory(new File(absoluteFileName), new File(destination));
}
}
} catch (IOException e1) {
if(StringUtils.endsWithIgnoreCase(e1.getMessage(), ErrorMessages.IO_EXCEPTION_MESSAGE_FOR_SAME_FILE)){
return true;
}
MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_ERROR | SWT.OK);
messageBox.setText(MessageType.ERROR.messageType());
messageBox.setMessage(ErrorMessages.UNABLE_TO_POPULATE_PARAM_FILE + " " + e1.getMessage());
messageBox.open();
logger.error("Unable to copy prameter file in current project work space");
return false;
}
}
return true;
}
示例7: checkEndsWith
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private static boolean checkEndsWith(String finalParamPath, String[] fileExtensions) {
for(String extension:fileExtensions){
if(StringUtils.endsWithIgnoreCase(finalParamPath, extension)){
return true;
}
}
return false;
}
示例8: getTextBoxValue
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private String getTextBoxValue() {
String textValue = text.getText();
if (!StringUtils.endsWithIgnoreCase(textValue, File.separator+"bin")) {
textValue = textValue + File.separator+"bin";
}
return textValue;
}
示例9: checkLoopback
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
* <pre>
* the table def:
* channel_info varchar
* channel_id varchar
* 每次解析时,每个事务首先获取 retl_mark 下的 channel_info 或 channel_id 字段变更。
* a. 如果存在 channel_info 以 '_SYNC'结尾的字符串 ,则忽略本次事务的数据变更;
* b. 如果不等于,则执行下面的判断。
* i. 如果存在channel_id = "xx",则检查对应的channel_id是否为当前同步的channelId,如果是则忽略。
* ii. 不存在则不处理
* </pre>
*/
private int checkLoopback(Pipeline pipeline, RowData rowData) {
// 检查channel_info字段
// 首先检查下after记录,从无变有的过程,一般出现在事务头
Column infokColumn = getColumnIgnoreCase(rowData.getAfterColumnsList(), pipeline.getParameters()
.getSystemMarkTableInfo());
// 匹配对应的channelInfo,如果以_SYNC结尾,则认为需要忽略
if (infokColumn != null && StringUtils.endsWithIgnoreCase(infokColumn.getValue(), RETL_CLIENT_FLAG)) {
return 1;
}
// 匹配对应的channelInfo,如果相同,则认为需要忽略,并返回2,代表需要进行回环补救check机制,因为这个变更也是otter系统产生的
if (infokColumn != null
&& StringUtils.equalsIgnoreCase(infokColumn.getValue(), pipeline.getParameters().getChannelInfo())) {
return 2;
}
infokColumn = getColumnIgnoreCase(rowData.getBeforeColumnsList(), pipeline.getParameters()
.getSystemMarkTableInfo());
// 匹配对应的channelInfo,如果以_SYNC结尾,则认为需要忽略
if (infokColumn != null && StringUtils.endsWithIgnoreCase(infokColumn.getValue(), RETL_CLIENT_FLAG)) {
return 1;
}
// 匹配对应的channelInfo,如果相同,则认为需要忽略,并返回2,代表需要进行回环补救check机制,因为这个变更也是otter系统产生的
if (infokColumn != null
&& StringUtils.equalsIgnoreCase(infokColumn.getValue(), pipeline.getParameters().getChannelInfo())) {
return 2;
}
// 检查channel_id字段
Column markColumn = getColumnIgnoreCase(rowData.getAfterColumnsList(), pipeline.getParameters()
.getSystemMarkTableColumn());
// 匹配对应的channel id
if (markColumn != null && pipeline.getChannelId().equals(Long.parseLong(markColumn.getValue()))) {
return 2;
}
markColumn = getColumnIgnoreCase(rowData.getBeforeColumnsList(), pipeline.getParameters()
.getSystemMarkTableColumn());
if (markColumn != null && pipeline.getChannelId().equals(Long.parseLong(markColumn.getValue()))) {
return 2;
}
return 0;
}
示例10: getSystemJavaHomeValue
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private String getSystemJavaHomeValue() {
String javaHome =System.getenv(JAVA_HOME);
if (!StringUtils.endsWithIgnoreCase(javaHome, SLASH_BIN))
javaHome = javaHome + SLASH_BIN;
return javaHome;
}