org.exist.fluent
Class NamedResource

java.lang.Object
  extended by org.exist.fluent.Resource
      extended by org.exist.fluent.NamedResource
Direct Known Subclasses:
Document, Folder

public abstract class NamedResource
extends Resource

A named resource in the contents tree of the database: either a folder or a document.

Author:
Piotr Kaminski

Nested Class Summary
static class NamedResource.MetadataFacet
          The metadata facet of a named resource.
 
Method Summary
abstract  NamedResource copy(Folder destination, Name name)
          Copy this resource to another location, potentially changing the copy's name in the process.
abstract  void delete()
          Delete this resource from the database.
abstract  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.
abstract  void move(Folder destination, Name name)
          Move this resource to another collection, potentially changing its name in the process.
abstract  String name()
          Return the local name of this resource.
abstract  String path()
          Return the absolute path of this resource.
 
Methods inherited from class org.exist.fluent.Resource
database, namespaceBindings, query
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

name

public abstract String name()
Return the local name of this resource. This name will never contain slashes.

Returns:
the local name of this resource

path

public abstract String path()
Return the absolute path of this resource. This is the path of its parent folder plus its local name.

Returns:
the absolute path of this resource

copy

public abstract NamedResource copy(Folder destination,
                                   Name name)
Copy this resource to another location, potentially changing the copy's name in the process.

Parameters:
destination - the destination folder for the copy
name - the desired name for the copy
Returns:
the new copy of the resource

move

public abstract void move(Folder destination,
                          Name name)
Move this resource to another collection, potentially changing its name in the process. This object will refer to the resource in its new location after this method returns.

Parameters:
destination - the destination folder for the move
name - the desired name for the moved resource

delete

public abstract void delete()
Delete this resource from the database.


metadata

public abstract 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.

Returns:
the metadata facet for this resource


Copyright (C) All rights reserved.