org.apache.wicket.util.string
Class UrlUtils

java.lang.Object
  extended by org.apache.wicket.util.string.UrlUtils

public class UrlUtils
extends Object

Various url utilities

Author:
igor.vaynberg

Method Summary
static boolean isRelative(String url)
          Checks if the url is relative or absolute
static String normalizePath(String path)
          Makes sure the path starts with a slash and does not end with a slash.
static String rewriteToContextRelative(String url, RequestCycle requestCycle)
          Rewrites a relative url to be context relative, leaves absolute urls same.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isRelative

public static boolean isRelative(String url)
Checks if the url is relative or absolute

Parameters:
url -
Returns:
true if url is relative, false otherwise

rewriteToContextRelative

public static String rewriteToContextRelative(String url,
                                              RequestCycle requestCycle)
Rewrites a relative url to be context relative, leaves absolute urls same.

Parameters:
url -
requestCycle -
Returns:
rewritten url

normalizePath

public static String normalizePath(String path)
Makes sure the path starts with a slash and does not end with a slash. Empty or null paths are normalized into an empty string.

Parameters:
path - path to normalize
Returns:
normalized path


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.