|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DirectoryAdapter
This is an adapter for a directory in the backing file system.
A directory adapter may want to keep track of its child
EntityAdapter
:s if it does not have a way, or at least a reasonably
performant way, of creating new adapter objects when they are requested. For
instance, a File
backed file system does not have to keep track of
created entity adapters since it can easily create new adapters based on the
File
objects in a directory. The RAM file system, on the other hand,
must keep track of its entity adapters since they contain the file data and
must survive the garbage collection of their respective entity objects.
Otherwise the RAM file system would forget data.
Method Summary | |
---|---|
void |
assertCanBeDeleted(Collection<String> childEntitiesToDelete)
Check if the directory can be deleted provided that all the childEntitiesToDelete entities were deleted first. |
boolean |
containsEntity(String name)
Check if the directory contains an entity with the given name (case sensitive or insensitive depending on the file system). |
void |
deleteChild(String name)
Delete the named child. |
EntityType |
getChildEntityType(String name)
Get the type of the child entity with the given name, |
String[] |
getEntityNames()
Get an array with the names of all child entities. |
Methods inherited from interface org.entityfs.impl.adapter.EntityAdapter |
---|
canRead, canWrite, create, delete, exists, getEntityType, getFileSystemAdapter, getLastModified, getName, getParent, init, rename, setLastModified |
Method Detail |
---|
boolean containsEntity(String name)
name
- The name of the entity.
true
if the directory contains the named entity, false
otherwise.EntityType getChildEntityType(String name)
name
- The name of the entity.
EntityType
, or null
if no such entity exists.String[] getEntityNames()
void assertCanBeDeleted(Collection<String> childEntitiesToDelete) throws DirectoryNotEmptyException, FileSystemException
childEntitiesToDelete
entities were deleted first. be empty.
childEntitiesToDelete
- The names of child entities to delete before
deleting the directory. This may be null
.
DirectoryNotEmptyException
- If the directory is not empty after
the named child entities have been deleted.
FileSystemException
- If the entity cannot be deleted.void deleteChild(String name) throws DirectoryNotEmptyException, FileSystemException
If the named child entity does not exist, this method exits silently.
name
- The name of the child to delete.
DirectoryNotEmptyException
- If the child is a directory that is
not empty.
FileSystemException
- On other errors.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |