org.apache.commons.vfs
Class NameScope

java.lang.Object
  extended byorg.apache.commons.vfs.NameScope

public final class NameScope
extends Object

An enumerated type for file name scope, used when resolving a name relative to a file.

Version:
$Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100 (Mi, 29 Nov 2006) $
Author:
Adam Murdoch

Field Summary
static NameScope CHILD
          Resolve against the children of the base file.
static NameScope DESCENDENT
          Resolve against the descendents of the base file.
static NameScope DESCENDENT_OR_SELF
          Resolve against the descendents of the base file.
static NameScope FILE_SYSTEM
          Resolve against files in the same file system as the base file.
 
Method Summary
 String getName()
          Returns the name of the scope.
 String toString()
          Returns the name of the scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CHILD

public static final NameScope CHILD
Resolve against the children of the base file. The name is resolved as described by FILE_SYSTEM. However, an exception is thrown if the resolved file is not a direct child of the base file.


DESCENDENT

public static final NameScope DESCENDENT
Resolve against the descendents of the base file. The name is resolved as described by FILE_SYSTEM. However, an exception is thrown if the resolved file is not a descendent of the base file.


DESCENDENT_OR_SELF

public static final NameScope DESCENDENT_OR_SELF
Resolve against the descendents of the base file. The name is resolved as described by FILE_SYSTEM. However, an exception is thrown if the resolved file is not a descendent of the base file, or the base files itself.


FILE_SYSTEM

public static final NameScope FILE_SYSTEM
Resolve against files in the same file system as the base file.

If the supplied name is an absolute path, then it is resolved relative to the root of the file system that the base file belongs to. If a relative name is supplied, then it is resolved relative to the base file.

The path may use any mix of /, \, or file system specific separators to separate elements in the path. It may also contain . and .. elements.

A path is considered absolute if it starts with a separator character, and relative if it does not.

Method Detail

toString

public String toString()
Returns the name of the scope.


getName

public String getName()
Returns the name of the scope.



Copyright © 2002-2006 The Apache Software Foundation. All Rights Reserved.