cz.cuni.amis.utils
Class FilePath

java.lang.Object
  extended by cz.cuni.amis.utils.FilePath

public class FilePath
extends java.lang.Object


Field Summary
static java.lang.String CLASSPATH_SEPARATOR
          Seperator of the classpath entries.
 
Constructor Summary
FilePath()
           
 
Method Summary
static void checkRelativePath(java.lang.String path)
          Checks the 'path' for the presence of ".." + can't start with "/" + enforces use of the ALLOWED_RELATIVE_PATH_CHARS.
static java.lang.String concatPaths(java.lang.String... paths)
          Concats all paths sequentially together replacing all backslashes with slashes and watches out for ending of the path1 and beginning of path2 solving "//", "/./", etc.
static java.lang.String concatPaths(java.lang.String path1, java.lang.String path2)
          Concats path1 and path2 replacing all backslashes with slashes and watches out for ending of the path1 and beginning of path2 solving "//", "/./", etc.
static void makeDirsToFile(java.io.File file)
          Treats 'file' as something that points to the file and creates all parent dirs.
static java.lang.String makeUniform(java.lang.String file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSPATH_SEPARATOR

public static final java.lang.String CLASSPATH_SEPARATOR
Seperator of the classpath entries.

See Also:
Constant Field Values
Constructor Detail

FilePath

public FilePath()
Method Detail

checkRelativePath

public static void checkRelativePath(java.lang.String path)
Checks the 'path' for the presence of ".." + can't start with "/" + enforces use of the ALLOWED_RELATIVE_PATH_CHARS.

Parameters:
path -

makeDirsToFile

public static void makeDirsToFile(java.io.File file)
Treats 'file' as something that points to the file and creates all parent dirs.

Parameters:
file -

concatPaths

public static java.lang.String concatPaths(java.lang.String... paths)
Concats all paths sequentially together replacing all backslashes with slashes and watches out for ending of the path1 and beginning of path2 solving "//", "/./", etc. Does not resolves "..".

Parameters:
paths -
Returns:

concatPaths

public static java.lang.String concatPaths(java.lang.String path1,
                                           java.lang.String path2)
Concats path1 and path2 replacing all backslashes with slashes and watches out for ending of the path1 and beginning of path2 solving "//", "/./", etc. Does not resolves "..".

Parameters:
path1 -
path2 -
Returns:

makeUniform

public static java.lang.String makeUniform(java.lang.String file)