JBoss VFS 3.1.0.Final-redhat-2

org.jboss.vfs.util
Class PathTokenizer

java.lang.Object
  extended by org.jboss.vfs.util.PathTokenizer

public class PathTokenizer
extends Object

PathTokenizer.

Version:
$Revision: 1.1 $
Author:
Adrian Brock, Ales Justin, David M. Lloyd

Method Summary
static List<String> applySpecialPaths(List<String> pathTokens)
          Apply any .
static String applySpecialPaths(String path)
          Apply any .
static String getRemainingPath(List<String> tokens, int i)
          Get the remaining path from some tokens
protected static String getRemainingPath(List<String> tokens, int i, int end)
          Get the remaining path from some tokens
static void getTokens(List<String> list, String path)
          Get the tokens that comprise this path and append them to the list.
static List<String> getTokens(String path)
          Get the tokens that comprise this path.
static boolean isCurrentToken(String token)
          Is current token.
static boolean isReverseToken(String token)
          Is reverse token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRemainingPath

protected static String getRemainingPath(List<String> tokens,
                                         int i,
                                         int end)
Get the remaining path from some tokens

Parameters:
tokens - the tokens
i - the current location
end - the end index
Returns:
the remaining path
Throws:
IllegalArgumentException - for null tokens or i is out of range

getTokens

public static List<String> getTokens(String path)
Get the tokens that comprise this path.

Parameters:
path - the path
Returns:
the tokens or null if the path is empty
Throws:
IllegalArgumentException - if the path is null

getTokens

public static void getTokens(List<String> list,
                             String path)
Get the tokens that comprise this path and append them to the list.

Parameters:
path - the path
Throws:
IllegalArgumentException - if the path is null

getRemainingPath

public static String getRemainingPath(List<String> tokens,
                                      int i)
Get the remaining path from some tokens

Parameters:
tokens - the tokens
i - the current location
Returns:
the remaining path
Throws:
IllegalArgumentException - for null tokens or i is out of range

applySpecialPaths

public static String applySpecialPaths(String path)
                                throws IllegalArgumentException
Apply any . or .. paths in the path param.

Parameters:
path - the path
Returns:
simple path, containing no . or .. paths
Throws:
IllegalArgumentException

applySpecialPaths

public static List<String> applySpecialPaths(List<String> pathTokens)
                                      throws IllegalArgumentException
Apply any . or .. paths in the pathTokens parameter, returning the minimal token list.

Parameters:
pathTokens - the path tokens
Returns:
the simple path tokens
Throws:
IllegalArgumentException - if reverse path goes over the top path

isCurrentToken

public static boolean isCurrentToken(String token)
Is current token.

Parameters:
token - the token to check
Returns:
true if token matches current path token

isReverseToken

public static boolean isReverseToken(String token)
Is reverse token.

Parameters:
token - the token to check
Returns:
true if token matches reverse path token

JBoss VFS 3.1.0.Final-redhat-2

Copyright © 2012 JBoss, A division of Red Hat, Inc. All Rights Reserved.