org.weborganic.bastille.util
Class Paths

java.lang.Object
  extended by org.weborganic.bastille.util.Paths

public final class Paths
extends Object

A utility class to manipulate paths.


Method Summary
static String normalize(String path)
          Filters and normalizes the value in the path informations.
static String path(String from, String to)
          Computes the path from a path to another.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

normalize

public static String normalize(String path)
Filters and normalizes the value in the path informations.

Parameters:
path - The path to normalize.
Returns:
The same path without an '/' at the end.

path

public static String path(String from,
                          String to)
Computes the path from a path to another.
 /          to /      => .
 /a         to /a     => .
 /a         to /b     => ../b
 /a/a/../c  to /a     => ../../a
 /          to /b     => b
 /          to /b/c   => b/c
 

Parameters:
from - The path to start from
to - The path to arrive at
Returns:
the path from a to b