Tabnine Logo
StringUtils.addEnd
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: pippo-java/pippo

properties.setProperty("myloader.resource.loader.prefix", StringUtils.addEnd(pathPrefix, "/"));
properties.setProperty("myloader.resource.loader.cache", String.valueOf(!pippoSettings.isDev()));
origin: pippo-java/pippo

  initFilterPath(filterConfig);
String applicationPath = StringUtils.addEnd(contextPath, "/") + StringUtils.removeStart(filterPath, "/");
application.getRouter().setApplicationPath(applicationPath);
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: ro.pippo/pippo-velocity

properties.setProperty("myloader.resource.loader.prefix", StringUtils.addEnd(pathPrefix, "/"));
properties.setProperty("myloader.resource.loader.cache", String.valueOf(!pippoSettings.isDev()));
origin: com.gitblit.fathom/fathom-rest

@Override
protected void setup() {
  String basePath = Strings.nullToEmpty(getSettings().getString(RestServlet.SETTING_URL, null)).trim();
  serve(basePath + "/*").with(RestServlet.class);
  final PippoSettings pippoSettings = getPippoSettings(getSettings());
  final Application application = new Application(pippoSettings);
  // must set context path before starting application
  application.getRouter().setContextPath(getSettings().getContextPath());
  // must set application path before starting application
  String contextPath = application.getRouter().getContextPath();
  String applicationPath = StringUtils.addEnd(contextPath, "/") + StringUtils.removeStart(basePath, "/");
  application.getRouter().setApplicationPath(applicationPath);
  // start the application which sets up all initializers
  application.init();
  bind(Application.class).toInstance(application);
  bind(Router.class).toInstance(application.getRouter());
  bind(Messages.class).toInstance(application.getMessages());
  bind(Languages.class).toInstance(application.getLanguages());
  bind(MimeTypes.class).toInstance(application.getMimeTypes());
  bind(ErrorHandler.class).toInstance(application.getErrorHandler());
  bind(TemplateEngine.class).toInstance(application.getTemplateEngine());
  bind(HttpCacheToolkit.class).toInstance(application.getHttpCacheToolkit());
  bind(ContentTypeEngines.class).toInstance(application.getContentTypeEngines());
  bind(RestService.class);
}
origin: gitblit/fathom

@Override
protected void setup() {
  String basePath = Strings.nullToEmpty(getSettings().getString(RestServlet.SETTING_URL, null)).trim();
  serve(basePath + "/*").with(RestServlet.class);
  final PippoSettings pippoSettings = getPippoSettings(getSettings());
  final Application application = new Application(pippoSettings);
  // must set context path before starting application
  application.getRouter().setContextPath(getSettings().getContextPath());
  // must set application path before starting application
  String contextPath = application.getRouter().getContextPath();
  String applicationPath = StringUtils.addEnd(contextPath, "/") + StringUtils.removeStart(basePath, "/");
  application.getRouter().setApplicationPath(applicationPath);
  // start the application which sets up all initializers
  application.init();
  bind(Application.class).toInstance(application);
  bind(Router.class).toInstance(application.getRouter());
  bind(Messages.class).toInstance(application.getMessages());
  bind(Languages.class).toInstance(application.getLanguages());
  bind(MimeTypes.class).toInstance(application.getMimeTypes());
  bind(ErrorHandler.class).toInstance(application.getErrorHandler());
  bind(TemplateEngine.class).toInstance(application.getTemplateEngine());
  bind(HttpCacheToolkit.class).toInstance(application.getHttpCacheToolkit());
  bind(ContentTypeEngines.class).toInstance(application.getContentTypeEngines());
  bind(RestService.class);
}
ro.pippo.core.utilStringUtilsaddEnd

Javadoc

Adds a substring only if the source string does not already end with the substring, 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.addEnd(null, *)      =  
StringUtils.addEnd("", *)        =  
StringUtils.addEnd(*, null)      =  
StringUtils.addEnd("www.", "domain.com")  = "www.domain.com" 
StringUtils.addEnd("123abc", "abc")    = "123abc" 

Popular methods of StringUtils

  • isNullOrEmpty
  • removeStart
  • removeEnd
  • 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

  • Making http post requests using okhttp
  • setContentView (Activity)
  • runOnUiThread (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Best IntelliJ plugins
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