classUtils.pack.util
Class PathNormalizer

java.lang.Object
  extended by classUtils.pack.util.PathNormalizer

public class PathNormalizer
extends java.lang.Object

An utility class to compute normalized paths (i.e. paths that do not contain neither "." nor "..")

Version:
1.0
Author:
C. Sadun

Constructor Summary
PathNormalizer()
           
 
Method Summary
static java.io.File normalize(java.io.File path)
          Normalizes a file object.
static java.lang.String normalizePath(java.lang.String path)
          Normalizes a string path.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathNormalizer

public PathNormalizer()
Method Detail

normalize

public static java.io.File normalize(java.io.File path)
Normalizes a file object. The returned file object will return the normalize path when File.getAbsolutePath() is invoked.

Parameters:
path - the File object to be normalized
Returns:
a File object whose absolute path name is normalized

normalizePath

public static java.lang.String normalizePath(java.lang.String path)
Normalizes a string path. The returned path does not contain ".." or "." references

Parameters:
path - the path to be normalized.
Returns:
a String object containing the normalized path