org.jboss.shotoku
Interface Directory

All Superinterfaces:
Resource

public interface Directory
extends Resource

Interface that must be implemented by classes which represent directories, that is resources, which can contain other directories and nodes.

Author:
Adam Warski (adamw@aster.pl), Damon Sicore (damon@sicore.com)

Method Summary
 java.util.List<Directory> getDirectories()
          Gets a list of directories that are contained in this directory.
 Directory getDirectory(java.lang.String name)
          Gets a node from the given directory with the given name.
 Node getNode(java.lang.String name)
          Gets a node from the given directory with the given name.
 NodeList getNodes()
          Gets a list of nodes that are contained in this directory.
 boolean hasIndex(java.lang.String propertyName)
          Checks if an index is created on the given property.
 Directory newDirectory(java.lang.String name)
          Creates a new directory in this directory.
 Node newNode(java.lang.String name)
          Creates and returns a new node in this directory.
 void setIndex(java.lang.String propertyName, boolean index)
          Creates or deletes an index on a property.
 
Methods inherited from interface org.jboss.shotoku.Resource
copyTo, delete, deleteProperty, getContentManager, getFullName, getLastModification, getLastModificationDate, getName, getParent, getProperties, getProperty, hasModifications, moveTo, save, setProperty
 

Method Detail

getNodes

NodeList getNodes()
                  throws RepositoryException
Gets a list of nodes that are contained in this directory. The nodes are sorted in alphabetic order.

Returns:
A list of nodes that are contained in this directory.
Throws:
RepositoryException

getDirectories

java.util.List<Directory> getDirectories()
                                         throws RepositoryException
Gets a list of directories that are contained in this directory. The directories are sorted in alphabetic order.

Returns:
A list of directories that are contained in this directory.
Throws:
RepositoryException

getNode

Node getNode(java.lang.String name)
             throws RepositoryException,
                    ResourceDoesNotExist
Gets a node from the given directory with the given name. The name can contain /, which just mean getting the node from some subdirectory.

Returns:
A node with the given name from this directory.
Throws:
RepositoryException
ResourceDoesNotExist

getDirectory

Directory getDirectory(java.lang.String name)
                       throws RepositoryException,
                              ResourceDoesNotExist
Gets a node from the given directory with the given name. The name can contain /, which just mean getting the directory from some subdirectory.

Returns:
A directory with the given name from this directory.
Throws:
RepositoryException
ResourceDoesNotExist

newNode

Node newNode(java.lang.String name)
             throws ResourceAlreadyExists,
                    NameFormatException,
                    RepositoryException
Creates and returns a new node in this directory. Only after saving, this node will be visible by other functions and persisted. As in getNode(String), the name can contain /. In such a case, new directories will be created if need be.

Parameters:
name - Name of the new node. It cannot contain spaces.
Returns:
A new node with the given name.
Throws:
ResourceAlreadyExists
NameFormatException
RepositoryException

newDirectory

Directory newDirectory(java.lang.String name)
                       throws ResourceAlreadyExists,
                              NameFormatException,
                              RepositoryException
Creates a new directory in this directory. Only after saving this directory, it will be visible by other functions and persisted. As in getDirectory(String), the name can contain /. In such a case, new directories will be created if need be.

Parameters:
name - Name of the directory to create. It cannot contain spaces.
Returns:
A new directory with the given name.
Throws:
ResourceAlreadyExists
NameFormatException
RepositoryException

hasIndex

boolean hasIndex(java.lang.String propertyName)
                 throws RepositoryException
Checks if an index is created on the given property. UNIMPLEMENTED!.

Parameters:
propertyName - Name of the property for which to check the index.
Returns:
True iff an index is created for the given property.
Throws:
RepositoryException

setIndex

void setIndex(java.lang.String propertyName,
              boolean index)
              throws RepositoryException
Creates or deletes an index on a property. The directory must be saved before this operation. UNIMPLEMENTED!.

Parameters:
propertyName - Name of the property for which to create/ delete an index.
index - True if and index should be created, false in an index should be deleted.
Throws:
RepositoryException


Copyright © -2006 . All Rights Reserved.