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

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

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

origin: pippo-java/pippo

public static Collection<String> getSuffixes(Method method) {
  Set<String> suffixes = new LinkedHashSet<>();
  for (String produces : getProduces(method)) {
    int i = produces.lastIndexOf('/') + 1;
    String type = StringUtils.removeStart(produces.substring(i).toLowerCase(), "x-");
    suffixes.add(type);
  }
  return suffixes;
}
origin: pippo-java/pippo

/**
 * Sets the engine for it's specified content type. An suffix for the engine is also registered based on the
 * specific type; extension types are supported and the leading "x-" is trimmed out.
 *
 * @param engine
 */
public void setContentTypeEngine(ContentTypeEngine engine) {
  String contentType = engine.getContentType();
  String suffix = StringUtils.removeStart(contentType.substring(contentType.lastIndexOf('/') + 1), "x-");
  engines.put(engine.getContentType(), engine);
  suffixes.put(suffix.toLowerCase(), engine);
  log.debug("'{}' content engine is '{}'", engine.getContentType(), engine.getClass().getName());
}
origin: pippo-java/pippo

@Override
public void redirect(String nameOrUriPattern, Map<String, Object> parameters) {
  String uri = uriFor(nameOrUriPattern, parameters);
  String applicationPath = application.getRouter().getApplicationPath();
  if (!applicationPath.isEmpty()) {
    // remove application path
    uri = StringUtils.removeStart(uri.substring(applicationPath.length()), "/");
  }
  redirect(uri);
}
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

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

  initFilterPath(filterConfig);
String applicationPath = StringUtils.addEnd(contextPath, "/") + StringUtils.removeStart(filterPath, "/");
application.getRouter().setApplicationPath(applicationPath);
origin: pippo-java/pippo

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

String undertowPropName = StringUtils.removeStart(propertyName, prefix);
String typeName = getTypeName(undertowPropName);
if (StringUtils.isNullOrEmpty(typeName))
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: com.gitblit.fathom/fathom-rest

public RouteRegistration contentTypeSuffixes(String... suffixes) {
  this.contentTypeSuffixes = new LinkedHashSet<>();
  for (String suffix : suffixes) {
    contentTypeSuffixes.add(StringUtils.removeStart(suffix.trim(), ".").toLowerCase());
  }
  return this;
}
origin: gitblit/fathom

public RouteRegistration contentTypeSuffixes(String... suffixes) {
  this.contentTypeSuffixes = new LinkedHashSet<>();
  for (String suffix : suffixes) {
    contentTypeSuffixes.add(StringUtils.removeStart(suffix.trim(), ".").toLowerCase());
  }
  return this;
}
origin: com.gitblit.fathom/fathom-rest

protected String getExclusionExpression(Collection<String> paths) {
  String joined = paths.stream().map(path -> StringUtils.removeStart(path, "/")).collect(Collectors.joining("|"));
  return "^(?!/(" + joined + ")/).*";
}
origin: com.gitblit.fathom/fathom-rest

public RouteRegistration contentTypeSuffixes(Collection<String> suffixes) {
  this.contentTypeSuffixes = new LinkedHashSet<>();
  for (String suffix : suffixes) {
    contentTypeSuffixes.add(StringUtils.removeStart(suffix.trim(), ".").toLowerCase());
  }
  return this;
}
origin: ro.pippo/pippo-controller

public static Collection<String> getSuffixes(Method method) {
  Set<String> suffixes = new LinkedHashSet<>();
  for (String produces : getProduces(method)) {
    int i = produces.lastIndexOf('/') + 1;
    String type = StringUtils.removeStart(produces.substring(i).toLowerCase(), "x-");
    suffixes.add(type);
  }
  return suffixes;
}
origin: com.gitblit.fathom/fathom-rest

public static Collection<String> getSuffixes(Method method) {
  Set<String> suffixes = new LinkedHashSet<>();
  for (String produces : getProduces(method)) {
    int i = produces.lastIndexOf('/') + 1;
    String type = StringUtils.removeStart(produces.substring(i).toLowerCase(), "x-");
    suffixes.add(type);
  }
  return suffixes;
}
origin: com.gitblit.fathom/fathom-rest

protected RouteRegistration addWebjarsResourceRoute(String basePath) {
  resourcePaths.add(StringUtils.removeStart(basePath, "/"));
  return GET(new WebjarsResourceHandler(basePath));
}
origin: com.gitblit.fathom/fathom-rest

protected RouteRegistration addFileResourceRoute(String basePath, File directory) {
  resourcePaths.add(StringUtils.removeStart(basePath, "/"));
  return GET(new FileResourceHandler(basePath, directory));
}
origin: com.gitblit.fathom/fathom-rest

protected RoutesModule addControllers() {
  String applicationPackage = Optional.fromNullable(settings.getApplicationPackage()).or("");
  String controllerPackage = StringUtils.removeStart(applicationPackage + ".controllers", ".");
  String controllersPackage = settings.getString(Settings.Setting.application_controllersPackage, controllerPackage);
  return addControllers(controllersPackage);
}
origin: com.gitblit.fathom/fathom-rest

private void setMetricClass(Class<? extends Annotation> metricClass, String name) {
  this.metricClass = metricClass;
  this.metricName = name == null ? (getRequestMethod() + "." + StringUtils.removeStart(getUriPattern(), "/")) : name;
}
origin: pippo-java/pippo

pathPrefix = StringUtils.removeStart(pathPrefix, "/");
builder.addTemplateLocator(new ClassPathTemplateLocator(10, pathPrefix, MUSTACHE));
ro.pippo.core.utilStringUtilsremoveStart

Javadoc

Removes a substring only if it is at the start 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.removeStart(null, *)      = null 
StringUtils.removeStart("", *)        = "" 
StringUtils.removeStart(*, null)      =  
StringUtils.removeStart("www.domain.com", "www.")  = "domain.com" 
StringUtils.removeStart("abc", "")    = "abc" 

Popular methods of StringUtils

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

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • addToBackStack (FragmentTransaction)
  • getExternalFilesDir (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Option (scala)
  • 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