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

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

Introduction

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

Prototype

public static String substringAfterLast(String str, String separator) 

Source Link

Document

Gets the substring after the last occurrence of a separator.

Usage

From source file:com.netflix.paas.dao.astyanax.AstyanaxDao.java

private static String entityNameFromClass(Class<?> entityType) {
    return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE,
            StringUtils.removeEnd(StringUtils.substringAfterLast(entityType.getName(), "."), "Entity"));
}

From source file:com.cognifide.slice.cq.TemplateManager.java

public String getName(final String pagePath) {
    String templatePath = getPath(pagePath);
    return StringUtils.substringAfterLast(templatePath, "/");
}

From source file:de.tudarmstadt.ukp.dkpro.core.testing.DkproTestContext.java

@Override
protected void starting(Description aDescription) {
    super.starting(aDescription);

    className = StringUtils.substringAfterLast(aDescription.getClassName(), ".");
    methodName = aDescription.getMethodName();
    System.out.println("\n=== " + methodName + " =====================");
    System.setProperty("org.apache.uima.logger.class", "org.apache.uima.util.impl.Log4jLogger_impl");

    context.set(this);
}

From source file:info.magnolia.cms.util.PathUtil.java

public static String getFileName(String path) {
    if (path.indexOf("/") >= 0) {
        return StringUtils.substringAfterLast(path, "/");
    }//from   w  w w  .j av  a  2s  . c  o  m
    return path;
}

From source file:info.magnolia.module.admininterface.AdminTreeMVCServlet.java

/**
 * @see info.magnolia.cms.servlets.MVCServlet#getHandler(javax.servlet.http.HttpServletRequest)
 *//*from  w w w .j  a va  2  s.  c  om*/
protected MVCServletHandler getHandler(HttpServletRequest request, HttpServletResponse response) {
    String handlerName = request.getRequestURI();
    handlerName = StringUtils.replaceOnce(StringUtils.substringAfterLast(handlerName, "/trees/"), ".html",
            StringUtils.EMPTY);

    return TreeHandlerManager.getInstance().getTreeHandler(handlerName, request, response);
}

From source file:gov.nih.nci.caarray.web.filter.CacheControlFilter.java

/**
 * {@inheritDoc}//from w ww . j  a  v a  2  s .c om
 */
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
        throws IOException, ServletException {

    if (!(response instanceof HttpServletResponse)) {
        chain.doFilter(request, response);
        return;
    }

    HttpServletRequest httpRequest = (HttpServletRequest) request;
    HttpServletResponse httpResponse = (HttpServletResponse) response;
    if (StringUtils.substringAfterLast(httpRequest.getRequestURI(), ".").equals(DYNAMIC_URL_EXTENSION)) {
        if (!request.isSecure()) { // workaround for IE files bug http://support.microsoft.com/kb/812935
            httpResponse.addHeader("Cache-control", "no-cache");
            httpResponse.addHeader("Pragma", "no-cache");
        }
        httpResponse.addIntHeader("Expires", 0);
    }
    chain.doFilter(request, response);
}

From source file:com.echosource.ada.lexer.TagNode.java

public String getLocalName() {
    String localPart = StringUtils.substringAfterLast(getNodeName(), ":");
    if (localPart == null) {
        return nodeName;
    } else {/*from w w  w .j  a v  a  2  s . c  o  m*/
        return localPart;
    }
}

From source file:info.magnolia.importexport.BootstrapFilesComparator.java

private static String getExtension(File file) {
    String ext = StringUtils.substringAfterLast(file.getName(), ".");
    if (("." + ext).equals(DataTransporter.GZ) || ("." + ext).equals(DataTransporter.ZIP)) {
        ext = StringUtils.substringAfterLast(StringUtils.substringBeforeLast(file.getName(), "."), ".");
    }/* w  ww. j  a  v a 2s.  co m*/
    return ext;
}

From source file:edu.ku.brc.specify.tools.datamodelgenerator.DataModelToCSV.java

protected String getLast(final String str) {
    if (str.indexOf('.') > -1) {
        return StringUtils.substringAfterLast(str, ".");
    }/*from w ww.  j a v a2s.  co  m*/
    return str;
}

From source file:adalid.util.io.SmallFile.java

private void init(String path, Charset[] charsets) {
    _name = path;//from  ww  w . ja  v a  2 s. co m
    //      _extension = StringUtils.substringAfter(StringUtils.substringAfterLast(path, FS), ".");
    _extension = StringUtils.trimToEmpty(StringUtils.substringAfterLast(path, "."));
    _path = Paths.get(path);
    _charsets = charsets;
}