org.apache.jackrabbit.core.fs
Class FileSystemPathUtil

java.lang.Object
  extended byorg.apache.jackrabbit.core.fs.FileSystemPathUtil

public final class FileSystemPathUtil
extends Object

The FileSystemPathUtil utility class ...


Field Summary
static BitSet SAVE_NAMECHARS
          The list of characters that are not encoded by the escapeName(String) and unescape(String) methods.
static BitSet SAVE_PATHCHARS
          The list of characters that are not encoded by the escapePath(String) and unescape(String) methods.
 
Method Summary
static String escapeName(String name)
          Encodes the specified name.
static String escapePath(String path)
          Encodes the specified path.
static String getName(String path)
          Returns the name of the specified path.
static String getParentDir(String path)
          Returns the parent directory of the specified path.
static String unescape(String pathOrName)
          Decodes the specified path/name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SAVE_NAMECHARS

public static final BitSet SAVE_NAMECHARS
The list of characters that are not encoded by the escapeName(String) and unescape(String) methods. They contains the characters which can savely be used in file names:


SAVE_PATHCHARS

public static final BitSet SAVE_PATHCHARS
The list of characters that are not encoded by the escapePath(String) and unescape(String) methods. They contains the characters which can savely be used in file paths:

Method Detail

escapePath

public static String escapePath(String path)
Encodes the specified path. Same as escapeName(String) except that the separator character / is regarded as a legal path character that needs no escaping.

Parameters:
path - the path to encode.
Returns:
the escaped path

escapeName

public static String escapeName(String name)
Encodes the specified name. Same as escapePath(String) except that the separator character / is regarded as an illegal character that needs escaping.

Parameters:
name - the name to encode.
Returns:
the escaped name

unescape

public static String unescape(String pathOrName)
Decodes the specified path/name.

Parameters:
pathOrName - the escaped path/name
Returns:
the unescaped path/name

getParentDir

public static String getParentDir(String path)
Returns the parent directory of the specified path.

Parameters:
path - a file system path denoting a directory or a file.
Returns:
the parent directory.

getName

public static String getName(String path)
Returns the name of the specified path.

Parameters:
path - a file system path denoting a directory or a file.
Returns:
the name.


Copyright © 2004-2005 The Apache Software Foundation. All Rights Reserved.