congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
StringUtils.removeEnd
Code IndexAdd Tabnine to your IDE (free)

How to use
removeEnd
method
in
ro.pippo.core.util.StringUtils

Best Java code snippets using ro.pippo.core.util.StringUtils.removeEnd (Showing top 20 results out of 315)

origin: pippo-java/pippo

private String getLocalizedTemplateName(String templateName, String localePart) {
  return StringUtils.removeEnd(templateName, "." + getFileExtension()) + "_" + localePart;
}
origin: pippo-java/pippo

@Override
public void setApplicationPath(String applicationPath) {
  if (StringUtils.isNullOrEmpty(applicationPath) || "/".equals(applicationPath.trim())) {
    this.applicationPath = "";
  } else {
    this.applicationPath = StringUtils.removeEnd(StringUtils.addStart(applicationPath, "/"), "/");
  }
}
origin: pippo-java/pippo

private String concatUriPattern(String prefix, String uriPattern) {
  uriPattern = StringUtils.addStart(StringUtils.addStart(uriPattern, "/"), prefix);
  return "/".equals(uriPattern) ? uriPattern : StringUtils.removeEnd(uriPattern, "/");
}
origin: pippo-java/pippo

paths.add(StringUtils.removeEnd(parentPath, "/") + "/" + StringUtils.removeStart(path, "/"));
origin: pippo-java/pippo

public List<String> toList(List<String> defaultValue) {
  if (isNull() || (values.length == 1 && StringUtils.isNullOrEmpty(values[0]))) {
    return defaultValue;
  }
  if (values.length == 1) {
    String tmp = values[0];
    tmp = StringUtils.removeStart(tmp, "[");
    tmp = StringUtils.removeEnd(tmp, "]");
    return StringUtils.getList(tmp, "(,|\\|)");
  }
  return Arrays.asList(values);
}
origin: pippo-java/pippo

protected List<DirEntry> getDirEntries(RouteContext routeContext, File dir, String absoluteDirUri) {
  List<DirEntry> list = new ArrayList<>();
  for (File file : getFiles(dir)) {
    String fileUrl = routeContext.getRequest().getApplicationPath()
      + StringUtils.removeEnd(StringUtils.addStart(absoluteDirUri, "/"), "/")
      + StringUtils.addStart(file.getName(), "/");
    list.add(new DirEntry(fileUrl, file));
  }
  if (comparator != null) {
    list.sort(comparator);
  }
  if (!directory.equals(dir)) {
    File upDir = new File(dir, "../");
    list.add(0, new DirEntry(routeContext.getRequest().getApplicationPath()
      + StringUtils.removeEnd(StringUtils.addStart(absoluteDirUri, "/"), "/")
      + StringUtils.addStart(upDir.getName(), "/"), upDir));
  }
  return list;
}
origin: pippo-java/pippo

public Response(HttpServletResponse httpServletResponse, Application application) {
  this.httpServletResponse = httpServletResponse;
  this.contentTypeEngines = application.getContentTypeEngines();
  this.templateEngine = application.getTemplateEngine();
  this.httpServletResponse.setCharacterEncoding(StandardCharsets.UTF_8.toString());
  this.contextPath = application.getRouter().getContextPath();
  this.applicationPath = StringUtils.removeEnd(application.getRouter().getApplicationPath(), "/");
  this.mimeTypes = application.getMimeTypes();
  this.status = 0;
}
origin: pippo-java/pippo

private PebbleTemplate getTemplate(String templateName, String localePart) throws PebbleException {
  PebbleTemplate template = null;
  try {
    if (StringUtils.isNullOrEmpty(localePart)) {
      template = engine.getTemplate(templateName);
    } else {
      String localizedName = StringUtils.removeEnd(templateName, "." +
        getFileExtension()) + "_" + localePart;
      template = engine.getTemplate(localizedName);
    }
  } catch (LoaderException e) {
    log.debug(e.getMessage());
  }
  return template;
}
origin: pippo-java/pippo

@Override
public void handle(RouteContext routeContext) {
  // get request path
  Request request = routeContext.getRequest();
  String path = request.getPath();
  // add or remove trailing slash
  if (path.length() > 1) {
    if (addSlash) {
      path = StringUtils.addEnd(path, "/");
    } else {
      path = StringUtils.removeEnd(path, "/");
    }
  }
  if (!path.equals(request.getPath())) {
    // redirect
    routeContext.redirect(path);
  } else {
    // continue with the next handler
    routeContext.next();
  }
}
origin: pippo-java/pippo

String path = Stream.of(StringUtils.removeEnd(controllerPath, "/"), StringUtils.removeStart(methodPath, "/"))
  .filter(Objects::nonNull)
  .collect(Collectors.joining("/"));
origin: pippo-java/pippo

templateName = StringUtils.removeEnd(templateName, "." + getFileExtension());
origin: pippo-java/pippo

@Override
public void init(Application application) {
  super.init(application);
  PippoSettings pippoSettings = getPippoSettings();
  TemplateConfiguration configuration = new TemplateConfiguration();
  configuration.setBaseTemplateClass(PippoGroovyTemplate.class);
  configuration.setAutoEscape(true);
  if (pippoSettings.isDev()) {
    // Do not cache templates in dev mode
    configuration.setCacheTemplates(false);
  } else {
    configuration.setAutoIndent(true);
    configuration.setAutoNewLine(true);
    configuration.setAutoIndentString("  ");
  }
  String pathPrefix = getTemplatePathPrefix();
  pathPrefix = StringUtils.removeStart(pathPrefix, "/");
  pathPrefix = StringUtils.removeEnd(pathPrefix, "/");
  GroovyTemplateResolver cachingResolver = new GroovyTemplateResolver(pathPrefix);
  ClassLoader classLoader = getClass().getClassLoader();
  // allow custom initialization
  init(application, configuration);
  engine = new MarkupTemplateEngine(classLoader, configuration, cachingResolver);
}
origin: ro.pippo/pippo-trimou

private String getLocalizedTemplateName(String templateName, String localePart) {
  return StringUtils.removeEnd(templateName, "." + getFileExtension()) + "_" + localePart;
}
origin: com.gitblit.fathom/fathom-rest

private String uriFor(String routeUriPattern) {
  String uri = addStart(addStart(routeUriPattern, "/"), routeGroupUriPattern);
  return "/".equals(uri) ? uri : StringUtils.removeEnd(uri, "/");
}
origin: gitblit/fathom

private String uriFor(String routeUriPattern) {
  String uri = addStart(addStart(routeUriPattern, "/"), routeGroupUriPattern);
  return "/".equals(uri) ? uri : StringUtils.removeEnd(uri, "/");
}
origin: ro.pippo/pippo-controller

paths.add(StringUtils.removeEnd(parentPath, "/") + "/" + StringUtils.removeStart(path, "/"));
origin: com.gitblit.fathom/fathom-rest

String fullPath = StringUtils.addStart(StringUtils.removeEnd(controllerPath, "/"), "/");
ControllerHandler handler = new ControllerHandler(injector, controllerClass, method.getName());
handler.validateMethodArgs(fullPath);
  String path = Joiner.on("/").skipNulls().join(StringUtils.removeEnd(controllerPath, "/"), StringUtils.removeStart(methodPath, "/"));
  String fullPath = StringUtils.addStart(StringUtils.removeEnd(path, "/"), "/");
origin: gitblit/fathom

String fullPath = StringUtils.addStart(StringUtils.removeEnd(controllerPath, "/"), "/");
ControllerHandler handler = new ControllerHandler(injector, controllerClass, method.getName());
handler.validateMethodArgs(fullPath);
  String path = Joiner.on("/").skipNulls().join(StringUtils.removeEnd(controllerPath, "/"), StringUtils.removeStart(methodPath, "/"));
  String fullPath = StringUtils.addStart(StringUtils.removeEnd(path, "/"), "/");
origin: ro.pippo/pippo-trimou

templateName = StringUtils.removeEnd(templateName, "." + getFileExtension());
origin: ro.pippo/pippo-groovy

@Override
public void init(Application application) {
  super.init(application);
  PippoSettings pippoSettings = getPippoSettings();
  TemplateConfiguration configuration = new TemplateConfiguration();
  configuration.setBaseTemplateClass(PippoGroovyTemplate.class);
  configuration.setAutoEscape(true);
  if (pippoSettings.isDev()) {
    // Do not cache templates in dev mode
    configuration.setCacheTemplates(false);
  } else {
    configuration.setAutoIndent(true);
    configuration.setAutoNewLine(true);
    configuration.setAutoIndentString("  ");
  }
  String pathPrefix = getTemplatePathPrefix();
  pathPrefix = StringUtils.removeStart(pathPrefix, "/");
  pathPrefix = StringUtils.removeEnd(pathPrefix, "/");
  GroovyTemplateResolver cachingResolver = new GroovyTemplateResolver(pathPrefix);
  ClassLoader classLoader = getClass().getClassLoader();
  // allow custom initialization
  init(application, configuration);
  engine = new MarkupTemplateEngine(classLoader, configuration, cachingResolver);
}
ro.pippo.core.utilStringUtilsremoveEnd

Javadoc

Removes a substring only if it is at the end of a source string, otherwise returns the source string.

A null source string will return null. An empty ("") source string will return the empty string. A null search string will return the source string.

 
StringUtils.removeEnd(null, *)      = null 
StringUtils.removeEnd("", *)        = "" 
StringUtils.removeEnd(*, null)      =  
StringUtils.removeEnd("www.domain.com", ".com.")  = "www.domain.com" 
StringUtils.removeEnd("www.domain.com", ".com")   = "www.domain" 
StringUtils.removeEnd("www.domain.com", "domain") = "www.domain.com" 
StringUtils.removeEnd("abc", "")    = "abc" 

Popular methods of StringUtils

  • isNullOrEmpty
  • removeStart
  • addEnd
  • addStart
  • format
  • getFileExtension
    Returns the file extension of the value without the dot or an empty string.
  • getList
  • getPrefix
    Returns the prefix of the input string from 0 to the first index of the delimiter OR it returns the

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Runner (org.openjdk.jmh.runner)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now