|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.support.lang.ObjectProxySupport<T>
org.entityfs.impl.AbstractEntityDelegateProxy<DirectoryDelegate,DirectoryAdapter>
org.entityfs.impl.AbstractDirectoryDelegateProxy
public abstract class AbstractDirectoryDelegateProxy
This is an abstract stub implementation of a directory delegate proxy. It forwards all method calls to the proxied delegate. This can be used as a starting point for custom implementations.
Constructor Summary | |
---|---|
protected |
AbstractDirectoryDelegateProxy(DirectoryDelegate proxied)
|
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. |
EntityImplementation |
createEntity(FileSystemImplementation fs,
String name,
EntityDelegate ed)
Create an entity object for the given delegate. |
void |
delete(Collection<String> c)
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 class org.entityfs.impl.AbstractEntityDelegateProxy |
---|
canRead, canWrite, copy, copyAttributes, exists, getDelegateOfTypeOrNull, getEntityAdapter, getFileSystem, getLastModified, getName, getOwner, init, isReadOnly, rename, setLastModified, setOwner |
Methods inherited from class org.entityfs.support.lang.ObjectProxySupport |
---|
equals, getProxied, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.entityfs.impl.DirectoryDelegate |
---|
createChildDelegate |
Methods inherited from interface org.entityfs.impl.EntityDelegate |
---|
canRead, canWrite, copy, copyAttributes, exists, getDelegateOfTypeOrNull, getEntityAdapter, getFileSystem, getLastModified, getName, getOwner, init, isReadOnly, rename, setLastModified, setOwner |
Constructor Detail |
---|
protected AbstractDirectoryDelegateProxy(DirectoryDelegate proxied)
Method Detail |
---|
public EntityType getEntityType(String name)
DirectoryDelegate
getEntityType
in interface DirectoryDelegate
name
- The name of the child entity.
null
if no child entity
with the supplied name exists.public boolean containsEntity(String name)
containsEntity
in interface DirectoryDelegate
public String[] getEntityNames()
DirectoryDelegate
getEntityNames
in interface DirectoryDelegate
public EntityImplementation createEntity(FileSystemImplementation fs, String name, EntityDelegate ed)
DirectoryDelegate
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)
).
createEntity
in interface DirectoryDelegate
fs
- The file system.name
- The name of the new entity.ed
- The new entity delegate.
public Set<EntityView> copyFromEntity(EntityImplementation ent, String targetName, boolean preserveAttrs, List<EntityAttributeSetter> asl, EntityLock[] setupLocks)
DirectoryDelegate
copyFromEntity
in interface DirectoryDelegate
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.public void delete(Collection<String> c) throws FileSystemException
DirectoryDelegate
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.
delete
in interface DirectoryDelegate
c
- 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 |