Example usage for org.apache.commons.lang StringUtils endsWithIgnoreCase

List of usage examples for org.apache.commons.lang StringUtils endsWithIgnoreCase

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils endsWithIgnoreCase.

Prototype

public static boolean endsWithIgnoreCase(String str, String suffix) 

Source Link

Document

Case insensitive check if a String ends with a specified suffix.

Usage

From source file:com.hangum.tadpole.engine.initialize.JDBCDriverLoader.java

/**
 * add JAR Loader of dir/*w  ww. j a va  2s.c o  m*/
 * 
 * @param strDir
 * @throws Exception
 */
public static void addJARDir(String strDir) throws Exception {
    //      if(logger.isDebugEnabled()) logger.debug("--> JAR path : " + strDir);

    File fileDir = new File(strDir);
    if (fileDir.isDirectory()) {
        File[] files = fileDir.listFiles();
        for (File file : files) {
            if (file.isDirectory()) {
                addJARDir(file.getAbsolutePath());
            } else {
                if (StringUtils.endsWithIgnoreCase(file.getName(), ".jar")) {
                    addJARLoader(new Object[] { file.toURI().toURL() });
                }
            }
        }

    } else {
        if (StringUtils.endsWithIgnoreCase(fileDir.getName(), ".jar")) {
            addJARLoader(new Object[] { fileDir.toURI().toURL() });
        }
    }
}

From source file:com.adaptris.core.services.metadata.compare.EndsWithIgnoreCase.java

@Override
public MetadataElement compare(MetadataElement firstItem, MetadataElement secondItem) {
    return new MetadataElement(getResultKey(),
            String.valueOf(StringUtils.endsWithIgnoreCase(firstItem.getValue(), secondItem.getValue())));
}

From source file:com.jd.bdp.hydra.hbase.service.impl.HbaseUtils.java

Annotation getSsAnnotation(List<Annotation> alist) {
    for (Annotation a : alist) {
        if (StringUtils.endsWithIgnoreCase("ss", a.getValue())) {
            return a;
        }//w ww. j  av a2 s  .c  om
    }
    return null;
}

From source file:jp.co.tis.gsp.tools.db.beans.Column.java

public Boolean isSingularPrimaryKey() {
    if (!isPrimaryKey() || isForeignKey())
        return false;
    for (Index index : entity.getIndexList()) {
        if (index.getColumnList().contains(this) && index.getColumnList().size() == 1
                && StringUtils.endsWithIgnoreCase(getName(), "_id"))
            return true;
    }//from  w  w  w.  j  av a  2 s .c  om
    return false;
}

From source file:com.jd.bdp.hydra.hbase.service.impl.HbaseUtils.java

Annotation getSrAnnotation(List<Annotation> alist) {
    for (Annotation a : alist) {
        if (StringUtils.endsWithIgnoreCase("sr", a.getValue())) {
            return a;
        }// ww  w  . ja va2 s. c o m
    }
    return null;
}

From source file:com.nagarro.core.util.ws.impl.AddonAwareMessageSource.java

public AddonAwareMessageSource() {
    this.scanForAddons = true;
    this.dirFilter = n -> {
        final String base = StringUtils.substringAfterLast(n, baseAddonDir.getPathWithinContext());
        return StringUtils.contains(base, File.separator);
    };/*  w  w  w.ja  va2s .  c o m*/
    this.fileFilter = n -> StringUtils.endsWithIgnoreCase(n, "xml")
            || StringUtils.endsWithIgnoreCase(n, "properties");
}

From source file:com.adobe.acs.commons.quickly.operations.impl.DuckDuckGoDocsOperationImpl.java

@Override
public boolean accepts(final SlingHttpServletRequest request, final Command cmd) {
    return StringUtils.endsWithIgnoreCase(CMD, cmd.getOp());
}

From source file:com.google.gdt.eclipse.designer.uibinder.editor.UiBinderPairResourceProvider.java

public IFile getPair(final IFile file) {
    return ExecutionUtils.runObjectIgnore(new RunnableObjectEx<IFile>() {
        public IFile runObject() throws Exception {
            String fileName = file.getName();
            if (StringUtils.endsWithIgnoreCase(fileName, ".ui.xml")) {
                return getJavaFile(file);
            }/*  ww w  .  j  a v a 2 s. c  o  m*/
            if (StringUtils.endsWithIgnoreCase(fileName, ".java")) {
                return getUIFile(file);
            }
            return null;
        }
    }, null);
}

From source file:com.alibaba.otter.manager.web.home.module.screen.api.NodeOp.java

public void execute(@Param("nid") Long nid, @Param("command") String command, @Param("value") String value) {
    try {//from   w  w w .ja  v  a  2 s .co m
        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);
    }
}

From source file:hudson.plugins.sonar.utils.LibraryPathResolver.java

protected String checkAndFixPattern(String pattern) {
    if (pattern.endsWith(LIBRARY_PATTERN)) {
        return pattern;
    }//from  ww  w. j av  a 2s.c o m

    String clearedPattern = pattern;

    if (StringUtils.endsWithIgnoreCase(clearedPattern, LIBRARY_EXTENSION)) {
        clearedPattern = StringUtils.removeEndIgnoreCase(clearedPattern, LIBRARY_EXTENSION);
    }

    return clearedPattern + LIBRARY_PATTERN;
}