UriPatternMatcher.matchUriRequestPattern
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.apache.http.protocol.UriPatternMatcher.matchUriRequestPattern(Showing top 11 results out of 315)

origin: org.apache.httpcomponents/httpcore

/**
 * Looks up an object matching the given request path.
 *
 * @param path the request path
 * @return object or {@code null} if no match is found.
 */
public synchronized T lookup(final String path) {
  Args.notNull(path, "Request path");
  // direct match?
  T obj = this.map.get(path);
  if (obj == null) {
    // pattern match?
    String bestMatch = null;
    for (final String pattern : this.map.keySet()) {
      if (matchUriRequestPattern(pattern, path)) {
        // we have a match. is it any better?
        if (bestMatch == null
            || (bestMatch.length() < pattern.length())
            || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) {
          obj = this.map.get(pattern);
          bestMatch = pattern;
        }
      }
    }
  }
  return obj;
}
origin: robovm/robovm

/**
 * @deprecated use {@link UriPatternMatcher} directly
 */
@Deprecated
protected boolean matchUriRequestPattern(final String pattern, final String requestUri) {
  return matcher.matchUriRequestPattern(pattern, requestUri);
}
origin: robovm/robovm

public Object lookup(String requestURI) {
  if (requestURI == null) {
    throw new IllegalArgumentException("Request URI may not be null");
  }
  //Strip away the query part part if found
  int index = requestURI.indexOf("?");
  if (index != -1) {
    requestURI = requestURI.substring(0, index);
  }
  // direct match?
  Object handler = this.handlerMap.get(requestURI);
  if (handler == null) {
    // pattern match?
    String bestMatch = null;
    for (Iterator it = this.handlerMap.keySet().iterator(); it.hasNext();) {
      String pattern = (String) it.next();
      if (matchUriRequestPattern(pattern, requestURI)) {
        // we have a match. is it any better?
        if (bestMatch == null
            || (bestMatch.length() < pattern.length())
            || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) {
          handler = this.handlerMap.get(pattern);
          bestMatch = pattern;
        }
      }
    }
  }
  return handler;
}
origin: MobiVM/robovm

/**
 * @deprecated use {@link UriPatternMatcher} directly
 */
@Deprecated
protected boolean matchUriRequestPattern(final String pattern, final String requestUri) {
  return matcher.matchUriRequestPattern(pattern, requestUri);
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * @deprecated use {@link UriPatternMatcher} directly
 */
@Deprecated
protected boolean matchUriRequestPattern(final String pattern, final String requestUri) {
  return matcher.matchUriRequestPattern(pattern, requestUri);
}
origin: intuit/wasabi

/**
 * Looks up an object matching the given request path.
 *
 * @param path the request path
 * @return object or <code>null</code> if no match is found.
 */
public synchronized T lookup(final String path) {
  Args.notNull(path, "Request path");
  // direct match?
  T obj = this.map.get(path);
  if (obj == null) {
    // pattern match?
    String bestMatch = null;
    for (final String pattern : this.map.keySet()) {
      if (matchUriRequestPattern(pattern, path)) {
        // we have a match. is it any better?
        if (bestMatch == null
            || (bestMatch.length() < pattern.length())
            || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) {
          obj = this.map.get(pattern);
          bestMatch = pattern;
        }
      }
    }
  }
  return obj;
}
origin: com.bugvm/bugvm-rt

/**
 * Looks up an object matching the given request path.
 *
 * @param path the request path
 * @return object or {@code null} if no match is found.
 */
public synchronized T lookup(final String path) {
  Args.notNull(path, "Request path");
  // direct match?
  T obj = this.map.get(path);
  if (obj == null) {
    // pattern match?
    String bestMatch = null;
    for (final String pattern : this.map.keySet()) {
      if (matchUriRequestPattern(pattern, path)) {
        // we have a match. is it any better?
        if (bestMatch == null
            || (bestMatch.length() < pattern.length())
            || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) {
          obj = this.map.get(pattern);
          bestMatch = pattern;
        }
      }
    }
  }
  return obj;
}
origin: Nextdoor/bender

/**
 * Looks up an object matching the given request path.
 *
 * @param path the request path
 * @return object or {@code null} if no match is found.
 */
public synchronized T lookup(final String path) {
  Args.notNull(path, "Request path");
  // direct match?
  T obj = this.map.get(path);
  if (obj == null) {
    // pattern match?
    String bestMatch = null;
    for (final String pattern : this.map.keySet()) {
      if (matchUriRequestPattern(pattern, path)) {
        // we have a match. is it any better?
        if (bestMatch == null
            || (bestMatch.length() < pattern.length())
            || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) {
          obj = this.map.get(pattern);
          bestMatch = pattern;
        }
      }
    }
  }
  return obj;
}
origin: Nextdoor/bender

/**
 * Looks up an object matching the given request path.
 *
 * @param path the request path
 * @return object or {@code null} if no match is found.
 */
public synchronized T lookup(final String path) {
  Args.notNull(path, "Request path");
  // direct match?
  T obj = this.map.get(path);
  if (obj == null) {
    // pattern match?
    String bestMatch = null;
    for (final String pattern : this.map.keySet()) {
      if (matchUriRequestPattern(pattern, path)) {
        // we have a match. is it any better?
        if (bestMatch == null
            || (bestMatch.length() < pattern.length())
            || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) {
          obj = this.map.get(pattern);
          bestMatch = pattern;
        }
      }
    }
  }
  return obj;
}
origin: MobiVM/robovm

public Object lookup(String requestURI) {
  if (requestURI == null) {
    throw new IllegalArgumentException("Request URI may not be null");
  }
  //Strip away the query part part if found
  int index = requestURI.indexOf("?");
  if (index != -1) {
    requestURI = requestURI.substring(0, index);
  }
  // direct match?
  Object handler = this.handlerMap.get(requestURI);
  if (handler == null) {
    // pattern match?
    String bestMatch = null;
    for (Iterator it = this.handlerMap.keySet().iterator(); it.hasNext();) {
      String pattern = (String) it.next();
      if (matchUriRequestPattern(pattern, requestURI)) {
        // we have a match. is it any better?
        if (bestMatch == null
            || (bestMatch.length() < pattern.length())
            || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) {
          handler = this.handlerMap.get(pattern);
          bestMatch = pattern;
        }
      }
    }
  }
  return handler;
}
origin: com.mobidevelop.robovm/robovm-rt

public Object lookup(String requestURI) {
  if (requestURI == null) {
    throw new IllegalArgumentException("Request URI may not be null");
  }
  //Strip away the query part part if found
  int index = requestURI.indexOf("?");
  if (index != -1) {
    requestURI = requestURI.substring(0, index);
  }
  // direct match?
  Object handler = this.handlerMap.get(requestURI);
  if (handler == null) {
    // pattern match?
    String bestMatch = null;
    for (Iterator it = this.handlerMap.keySet().iterator(); it.hasNext();) {
      String pattern = (String) it.next();
      if (matchUriRequestPattern(pattern, requestURI)) {
        // we have a match. is it any better?
        if (bestMatch == null
            || (bestMatch.length() < pattern.length())
            || (bestMatch.length() == pattern.length() && pattern.endsWith("*"))) {
          handler = this.handlerMap.get(pattern);
          bestMatch = pattern;
        }
      }
    }
  }
  return handler;
}
org.apache.http.protocolUriPatternMatchermatchUriRequestPattern

Javadoc

Tests if the given request path matches the given pattern.

Popular methods of UriPatternMatcher

  • lookup
    Looks up an object matching the given request path.
  • register
    Registers the given object for URIs matching the given pattern.
  • unregister
    Removes registered object, if exists, for the given pattern.
  • getObjects
  • setObjects
  • <init>
  • setHandlers

Popular classes and methods

  • getSharedPreferences (Context)
  • putExtra (Intent)
  • getSupportFragmentManager (FragmentActivity)
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)