Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tonbeller.wcf.utils
Class UrlUtils

    java.lang.Object
      com.tonbeller.wcf.utils.UrlUtils

public class UrlUtils
extends java.lang.Object

Since:
  12.07.2004
Author:
  av

Field Summary
`static java.lang.String` | `URLENCODING` Deprecated. - use `CharsetFilter.getEncoding()` instead

Method Summary
`static java.lang.String` | `forceExtension(java.lang.String url, java.lang.String ext)` ensures that the extension of the file portion matches ext.
`static java.lang.String` | `forceExtension(java.lang.String url, java.lang.String old, java.lang.String ext)`
`static boolean` | `matchPattern(javax.servlet.http.HttpServletRequest req, java.lang.String[] urlPattern)` true, if the request uri matches one of the url patterns.
`static boolean` | `matchPattern(java.lang.String uri, java.lang.String pattern)` true if requestUri matches one of the urlPatterns
`static boolean` | `matchPattern(java.lang.String uri, java.lang.String[] pattern)` true if requestUri matches one of the urlPatterns
`static java.lang.String[]` | `parseUrlPatternList(java.lang.String urlPatternList)` parses urlPatterns from a whitespace separated list.
`static java.lang.String` | `redirectURI(javax.servlet.http.HttpServletRequest request, java.lang.String uri)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### URLENCODING

    public static final java.lang.String URLENCODING

  Deprecated. - use `CharsetFilter.getEncoding()` instead

  URL encoding to be used with

  See Also:
    Constant Field Values

Method Detail

### forceExtension

    public static java.lang.String forceExtension(java.lang.String url,
                                                  java.lang.String ext)

  ensures that the extension of the file portion matches ext. E.g. forceExtension("/a/b.jsp?x=y", ".jspx") will return "/a/b.jspx?x=y".

  Parameters:
    `url` - the url to modify
    `ext` - the required extension

### matchPattern

    public static boolean matchPattern(javax.servlet.http.HttpServletRequest req,
                                       java.lang.String[] urlPattern)

  true, if the request uri matches one of the url patterns.

  Parameters:
    `req` - the request
    `urlPattern` - an url pattern may start with "*.ext" which is an extension mapping or end with "/*" which is a prefix mapping, or "/" which matches everything.

### matchPattern

    public static boolean matchPattern(java.lang.String uri,
                                       java.lang.String[] pattern)

  true if requestUri matches one of the urlPatterns

  Parameters:
    `uri` - w/o contextPath
    `pattern` -

### matchPattern

    public static boolean matchPattern(java.lang.String uri,
                                       java.lang.String pattern)

  true if requestUri matches one of the urlPatterns

  Parameters:
    `uri` - w/o contextPath
    `pattern` -

### parseUrlPatternList

    public static java.lang.String[] parseUrlPatternList(java.lang.String urlPatternList)

  parses urlPatterns from a whitespace separated list.

  Returns:
    null if urlPatternList is null

### forceExtension

    public static java.lang.String forceExtension(java.lang.String url,
                                                  java.lang.String old,
                                                  java.lang.String ext)

### redirectURI

    public static java.lang.String redirectURI(javax.servlet.http.HttpServletRequest request,
                                               java.lang.String uri)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD