/** Adds a url-pattern */
  public void addURLPattern(String pattern) throws PatternSyntaxException {
    String regexpPattern = UrlMap.urlPatternToRegexpPattern(pattern);

    int flags = (CauchoSystem.isCaseInsensitive() ? Pattern.CASE_INSENSITIVE : 0);

    Pattern regexp = Pattern.compile(regexpPattern, flags);

    _urlPatternList.add(regexp);
  }
Esempio n. 2
0
  /** Sets the url-pattern */
  public void addURLPattern(String pattern) {
    String regexpPattern = UrlMap.urlPatternToRegexpPattern(pattern);

    int flags = (CauchoSystem.isCaseInsensitive() ? Pattern.CASE_INSENSITIVE : 0);
    try {
      _regexp = Pattern.compile(regexpPattern, flags);
    } catch (PatternSyntaxException e) {
      log.log(Level.WARNING, e.toString(), e);
    }
  }
Esempio n. 3
0
  /** Finds the web-app matching the current entry. */
  public WebAppUriMap findEntryByURI(String uri) {
    if (_appDeploy.isModified()) _uriToAppCache.clear();

    WebAppUriMap entry = _uriToAppCache.get(uri);

    if (entry != null) return entry;

    String cleanUri = uri;
    if (CauchoSystem.isCaseInsensitive()) cleanUri = cleanUri.toLowerCase(Locale.ENGLISH);

    // server/105w
    try {
      cleanUri = getInvocationDecoder().normalizeUri(cleanUri);
    } catch (java.io.IOException e) {
      log.log(Level.FINER, e.toString(), e);
    }

    entry = findByURIImpl(cleanUri);

    _uriToAppCache.put(uri, entry);

    return entry;
  }