|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DirectoryDelegate
This defines the delegate of a directory entity.
Method Summary | |
---|---|
boolean |
containsEntity(String name)
|
Set<EntityView> |
copyFromEntity(EntityImplementation ent,
String targetName,
boolean preserveAttrs,
List<EntityAttributeSetter> asl,
EntityLock[] setupLocks)
Copy an entity to this directory. |
EntityDelegate |
createChildDelegate(FileSystemImplementation fs,
EntityType et,
String name,
Object data,
boolean createInBackend)
Create a delegate for a child entity. |
EntityImplementation |
createEntity(FileSystemImplementation fs,
String name,
EntityDelegate ed)
Create an entity object for the given delegate. |
void |
delete(Collection<String> childEntitiesToDelete)
Delete the directory. |
String[] |
getEntityNames()
Get a set with the names of all child entities. |
EntityType |
getEntityType(String name)
Get the type of the child entity. |
Methods inherited from interface org.entityfs.impl.EntityDelegate |
---|
canRead, canWrite, copy, copyAttributes, exists, getDelegateOfTypeOrNull, getEntityAdapter, getFileSystem, getLastModified, getName, getOwner, init, isReadOnly, rename, setLastModified, setOwner |
Method Detail |
---|
EntityType getEntityType(String name)
name
- The name of the child entity.
null
if no child entity
with the supplied name exists.boolean containsEntity(String name)
String[] getEntityNames()
EntityDelegate createChildDelegate(FileSystemImplementation fs, EntityType et, String name, Object data, boolean createInBackend)
FSCPersistent
file system).
Implementations of this method cannot assume that this delegate's owner is set since the method may be called before this delegate is fully initialized.
data
- Data used for creating the delegate. If the created entity is
a file and the data contains a FileDelegate
, the contents of the
supplied FileDelegate
is moved to the new delegate. The caller
must ensure that the supplied FileDelegate
object is discarded.createInBackend
- Should the entity be created in the backend? If
false
, the backend representation (the File
, for
instance) must already exist.EntityImplementation createEntity(FileSystemImplementation fs, String name, EntityDelegate ed)
Delegates for exotic new entity types can implement this to create entity objects of types that the directory implementation is not aware of. This method can also be used by delegates to initialize themselves if they need the entity object to do so.
This method is responsible for registering the new entity with its parent
directory (through
DirectoryImplementation.addChildEntity(String, EntityImplementation)
).
fs
- The file system.name
- The name of the new entity.ed
- The new entity delegate.
Set<EntityView> copyFromEntity(EntityImplementation ent, String targetName, boolean preserveAttrs, List<EntityAttributeSetter> asl, EntityLock[] setupLocks)
ent
- The entity to copy.targetName
- The name of the entity to create.preserveAttrs
- Should entity attributes be copied to the target
entity?asl
- A list of entity attribute setters that are run just after the
target entity has been created and before the setup locks are released.
The setters are run in the order that they are stored in the list. May be
null
. This may only be non-null
when preserveAttrs
is set to true
.setupLocks
- Exception to the rule that the delegate should not
bother with locking. This is here so that the delegate can release the
lock needed for creating a new entity just after it has been created (but
before data is copied to it). This method is responsible for unlocking
this lock regardless of whether it is successful or fails.void delete(Collection<String> childEntitiesToDelete) throws DirectoryNotEmptyException, FileSystemException
Since capabilities may add files to a directory that are not visible to the client, this method takes a collection of names of child files that should be deleted before the directory is deleted. If the directory would not be deleted after all named files had been deleted, nothing should be deleted.
childEntitiesToDelete
- The names of child entities to delete before
the directory is deleted. Capability delegates that use files in the
directory add to this collection. If no names have been added yet, this
argument may be null
. Implementations have to check that. before
calling their proxied delegate. (See comment above.)
DirectoryNotEmptyException
- If the directory would not be empty
after all the child entities in childEntities
had been deleted.
FileSystemException
- If the entity cannot be deleted.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |