org.nuxeo.core.resources.model.impl
Class ResourceTreeRoot

java.lang.Object
  extended by org.nuxeo.core.resources.model.impl.ResourceTreeRoot
All Implemented Interfaces:
IContainer, IResourceTreeRoot

public class ResourceTreeRoot
extends java.lang.Object
implements IResourceTreeRoot

Author:
Bogdan Stefanescu

Field Summary
 
Fields inherited from interface org.nuxeo.core.resources.model.IContainer
EMPTY_CHILDREN
 
Constructor Summary
ResourceTreeRoot()
           
 
Method Summary
 void addSite(ISite site)
          Add this site to the container
 ISiteResource[] children(org.eclipse.core.runtime.IProgressMonitor monitor)
          Get an array with existing children in this container
 ISiteResource findChild(java.lang.String path)
          Find the child given its relative path to this container The returned child is existing
 ISite findContainerSite(java.lang.String uri)
          Find the site containing that may contains a resource with the given URI
If more than one sites are found the site with the longest URI is returned
 ISite findSite(java.lang.String uri)
          Find a defined site given the site URI
 ISite[] findSites()
          Find all defined sites in this container
 ISite getSite(java.lang.String uri)
          Get a handle for a site having the given URI This is a handle operation so the site handle is returned even if the site is not existing
 void removeSite(ISite site)
          Remove the site from the container
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceTreeRoot

public ResourceTreeRoot()
Method Detail

findSites

public ISite[] findSites()
Description copied from interface: IResourceTreeRoot
Find all defined sites in this container

Specified by:
findSites in interface IResourceTreeRoot
Returns:
the defined sites. If the container is empty returns an empty list

findSite

public ISite findSite(java.lang.String uri)
Description copied from interface: IResourceTreeRoot
Find a defined site given the site URI

Specified by:
findSite in interface IResourceTreeRoot
Parameters:
uri - the site URI
Returns:
the site or null if no suvh site exists

findContainerSite

public ISite findContainerSite(java.lang.String uri)
Description copied from interface: IResourceTreeRoot
Find the site containing that may contains a resource with the given URI
If more than one sites are found the site with the longest URI is returned

Specified by:
findContainerSite in interface IResourceTreeRoot
Parameters:
uri - the resource URI
Returns:
the site containing this resource

addSite

public void addSite(ISite site)
Description copied from interface: IResourceTreeRoot
Add this site to the container

Specified by:
addSite in interface IResourceTreeRoot

removeSite

public void removeSite(ISite site)
Description copied from interface: IResourceTreeRoot
Remove the site from the container

Specified by:
removeSite in interface IResourceTreeRoot

getSite

public ISite getSite(java.lang.String uri)
Description copied from interface: IResourceTreeRoot
Get a handle for a site having the given URI This is a handle operation so the site handle is returned even if the site is not existing

Specified by:
getSite in interface IResourceTreeRoot
Parameters:
uri - the site URI
Returns:
the site handle. Cannot be null

findChild

public ISiteResource findChild(java.lang.String path)
                        throws org.eclipse.core.runtime.CoreException
Description copied from interface: IContainer
Find the child given its relative path to this container The returned child is existing

Specified by:
findChild in interface IContainer
Parameters:
path - the relative path
Returns:
the child if found otherwise null
Throws:
org.eclipse.core.runtime.CoreException

children

public ISiteResource[] children(org.eclipse.core.runtime.IProgressMonitor monitor)
                         throws org.eclipse.core.runtime.CoreException
Description copied from interface: IContainer
Get an array with existing children in this container

Specified by:
children in interface IContainer
Parameters:
monitor - the progress monitor to use or null if not required
Returns:
an array with existing child resources or an empty array if no children are found
Throws:
org.eclipse.core.runtime.CoreException