org.ops4j.pax.web.extender.war.internal.util
Class Path

java.lang.Object
  extended by org.ops4j.pax.web.extender.war.internal.util.Path

public class Path
extends java.lang.Object

Divers utilities related to request paths (copy of the same class form Pax Web).

Since:
0.3.0
Author:
Alin Dreghiciu

Method Summary
static java.lang.String getDirectParent(java.net.URL entry)
          Finds the direct parent of the path of the given URL.
static java.lang.String normalizeResourcePath(java.lang.String path)
          Normalize the path for accesing a resource, meaning that will replace consecutive slashes and will remove a leading slash if present.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

normalizeResourcePath

public static java.lang.String normalizeResourcePath(java.lang.String path)
Normalize the path for accesing a resource, meaning that will replace consecutive slashes and will remove a leading slash if present.

Parameters:
path - path to normalize
Returns:
normalized path or the original path if there is nothing to be replaced.

getDirectParent

public static java.lang.String getDirectParent(java.net.URL entry)
Finds the direct parent of the path of the given URL. E.g. /parent/file.xml yields parent, but /parent/file.xml/ yields file.xml

Parameters:
entry - A location.
Returns:
The (bare) parent path.


Copyright © 2006-2011 OPS4J - Open Participation Software for Java. All Rights Reserved.