org.apache.xindice.webadmin
Class Location
java.lang.Object
org.apache.xindice.webadmin.Location
- public class Location
- extends Object
Helper class for parsing path information to get database, collection
and resource name.
- Version:
- $Revision: 551434 $, $Date: 2007-06-27 23:25:05 -0400 (Wed, 27 Jun 2007) $
Constructor Summary |
Location(String path)
Create Location instance out of path information. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Location
public Location(String path)
throws DBException
- Create Location instance out of path information. There are several
possible outcomes:
- Path is empty or "/" - both collection and name are null, isRoot
equals true;
- Path matches some collection's canonical name - collection is
set to that collection, name is null, isRoot equals false;
- Path matches some document's canonical name - collection is set
to the document's collection, name is document name, isRoot equals
false;
- Path could not be recognized, no database/collection match found -
both collection and name are null, isRoot equals false
In case there are collection and document that have the same name,
collection has a precedence over the document.
For example, if path is /db/col1/test, and collection col1 contains
child collection test and a document test, collection test will be
returned, not a document.
- Parameters:
path
- Path string
- Throws:
DBException
getCollection
public Collection getCollection()
getName
public String getName()
isRoot
public boolean isRoot()
Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.