|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.exist.fluent.Resource org.exist.fluent.NamedResource org.exist.fluent.Folder
public class Folder
A named collection of XML documents in the database. Each document belongs to precisely one folder. Folders can be nested, with queries carried out within either the scope of a single folder or of a whole subtree.
Though the name Collection
is commonly used for these
constructs in the context of XML databases, the name Folder
was
chosen instead to avoid conflicting with the ubiquitous Java java.util.Collection
interface.
Instances of this class are not thread-safe.
Nested Class Summary | |
---|---|
class |
Folder.ChildrenFacet
The children (subfolders) facet of a collection. |
class |
Folder.DocumentsFacet
The immediate documents facet of a folder. |
static class |
Folder.Event
An event that concerns a folder. |
static interface |
Folder.Listener
Listener for events affecting folders. |
class |
Folder.ListenersFacet
The facet that allwos control over listeners to the folder, and all its descendant folders and documents. |
Nested classes/interfaces inherited from class org.exist.fluent.NamedResource |
---|
NamedResource.MetadataFacet |
Method Summary | |
---|---|
Folder.ChildrenFacet |
children()
Return the children facet of this folder that gives access to operations on its subfolders and descendants. |
void |
clear()
Remove all resources and subfolders from this folder, but keep the folder itself. |
Folder |
clone()
Create a duplicate handle that copies the original's path and namespace bindings. |
Folder |
cloneWithoutNamespaceBindings()
|
boolean |
contains(NamedResource res)
Return whether this folder or one of its descendants contains the given named resource. |
Folder |
copy(Folder destination,
Name name)
Copy this folder to another place in the folder hierarchy, returning the newly copied folder with namespace bindings inherited from this one. |
void |
delete()
Delete this folder, including all documents and descendants. |
Folder.DocumentsFacet |
documents()
Provide access to the documents facet of this folder. |
boolean |
equals(Object o)
|
void |
export(File destination)
Export the contents of this folder (both documents and subfolders) to the given directory. |
int |
hashCode()
|
boolean |
isEmpty()
Return whether this folder is empty, i.e. |
Folder.ListenersFacet |
listeners()
Return this folder's listeners facet, giving control over listeners to events on this folder, its contents, and all its descendants. |
NamedResource.MetadataFacet |
metadata()
Return the metadata facet for this resource, which lets you read and manipulate metadata such as ownership, access permissions, and creation/modification timestamps. |
void |
move(Folder destination,
Name name)
Move this folder to another spot in the folder hierarchy, possibly changing its name in the process. |
String |
name()
Return the local name of the folder; this is the last segment of its path. |
Folder |
parent()
Return the parent folder of this folder. |
String |
path()
Return the full path to the folder; always starts with '/'. |
QueryService |
query()
Return a query service for executing queries over the contents of this folder and the contents of all its descendants. |
String |
relativePath(String subPath)
Return the given path stripped of this folder's prefix path, i.e. |
String |
toString()
|
Methods inherited from class org.exist.fluent.Resource |
---|
database, namespaceBindings |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public Folder.ListenersFacet listeners()
public NamedResource.MetadataFacet metadata()
NamedResource
metadata
in class NamedResource
public Folder clone()
clone
in class Object
public Folder cloneWithoutNamespaceBindings()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public boolean isEmpty()
public void clear()
public void delete()
delete
in class NamedResource
public void move(Folder destination, Name name)
folder.move(destFolder, Name.keepCreate())
)
or to rename it without changing its location (folder.move(folder.parent(), Name.create(newName))
).
move
in class NamedResource
destination
- the new parent folder of this foldername
- the new name for this folderpublic Folder copy(Folder destination, Name name)
copy
in class NamedResource
destination
- the desired parent folder of the copyname
- the desired name of the copy
public Folder.DocumentsFacet documents()
public boolean contains(NamedResource res)
res
- the resource to check for
true
if the resource is contained (directly or indirectly) in this folder, false
otherwisepublic String relativePath(String subPath)
subPath
- the path to relativize
public String path()
path
in class NamedResource
public String name()
name
in class NamedResource
public Folder parent()
DatabaseException
- if this is the root folderpublic Folder.ChildrenFacet children()
public void export(File destination) throws IOException
destination
- the destination folder to export into
IOException
- if the export failed due to an I/O errorpublic QueryService query()
the documents facet
.
query
in class Resource
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |