|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.impl.impl.adapter.AbstractRWEntityAdapter<RamFileSystemAdapter,RamDirectoryAdapter>
org.entityfs.ram.AbstractRamEntityAdapter
org.entityfs.ram.RamDirectoryAdapter
public final class RamDirectoryAdapter
Constructor Summary | |
---|---|
RamDirectoryAdapter(RamFileSystemAdapter fs,
RamDirectoryAdapter parent,
String name)
|
Method Summary | |
---|---|
void |
assertCanBeDeleted(Collection<String> cetd)
Override the inherited implementation and add the check to see if the directory is empty. |
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. |
EntityAdapter |
getChild(String name)
Get the adapter for a child entity. |
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. |
EntityType |
getEntityType()
Get the EntityType for this entity. |
T |
getFileSystemAdapter()
Get the FileSystemAdapter for the file system where the entity
is. |
void |
init()
This implementation does nothing. |
void |
registerChild(EntityAdapter ea)
This is used by directory adapters that have to keep track of child entities themselves (the RAM file system directory adapters, for instance). |
String |
toString()
|
void |
unregisterChild(EntityAdapter ea)
For directory adapters that keep track of all child entities themselves, this method is used to unregister a child entity that is deleted or moved from the directory. |
Methods inherited from class org.entityfs.ram.AbstractRamEntityAdapter |
---|
canRead, canWrite, create, delete, exists, getLastModified, rename, setLastModified |
Methods inherited from class org.entityfs.impl.impl.adapter.AbstractRWEntityAdapter |
---|
getName, getParent, setName, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.entityfs.impl.adapter.EntityAdapter |
---|
canRead, canWrite, create, delete, exists, getFileSystemAdapter, getLastModified, getName, getParent, init, rename, setLastModified |
Constructor Detail |
---|
public RamDirectoryAdapter(RamFileSystemAdapter fs, RamDirectoryAdapter parent, String name)
parent
- name
- Method Detail |
---|
public boolean containsEntity(String name)
DirectoryAdapter
containsEntity
in interface DirectoryAdapter
name
- The name of the entity.
true
if the directory contains the named entity, false
otherwise.public EntityType getChildEntityType(String name)
DirectoryAdapter
getChildEntityType
in interface DirectoryAdapter
name
- The name of the entity.
EntityType
, or null
if no such entity exists.public String[] getEntityNames()
DirectoryAdapter
getEntityNames
in interface DirectoryAdapter
public void assertCanBeDeleted(Collection<String> cetd)
assertCanBeDeleted
in interface DirectoryAdapter
cetd
- The names of child entities to delete before
deleting the directory. This may be null
.public void registerChild(EntityAdapter ea)
ChildRegisteringDirectoryAdapter
This method is called by the directory entity implementation when a new entity is created or an existing entity is found.
registerChild
in interface ChildRegisteringDirectoryAdapter
ea
- The child entity adapter to register.ChildRegisteringDirectoryAdapter.unregisterChild(EntityAdapter)
,
ChildRegisteringDirectoryAdapter.getChild(String)
public void unregisterChild(EntityAdapter ea)
ChildRegisteringDirectoryAdapter
This method should be called by entity adapter methods that move or delete entities.
unregisterChild
in interface ChildRegisteringDirectoryAdapter
ea
- The child to unregister.ChildRegisteringDirectoryAdapter.registerChild(EntityAdapter)
,
ChildRegisteringDirectoryAdapter.getChild(String)
,
EntityAdapter.delete()
,
EntityAdapter.rename(String, DirectoryAdapter)
public EntityAdapter getChild(String name)
ChildRegisteringDirectoryAdapter
getChild
in interface ChildRegisteringDirectoryAdapter
name
- The name of the child entity.
ChildRegisteringDirectoryAdapter.registerChild(EntityAdapter)
,
ChildRegisteringDirectoryAdapter.unregisterChild(EntityAdapter)
public EntityType getEntityType()
EntityAdapter
EntityType
for this entity.
getEntityType
in interface EntityAdapter
EntityType
for this entity.public void deleteChild(String name)
DirectoryAdapter
If the named child entity does not exist, this method exits silently.
deleteChild
in interface DirectoryAdapter
name
- The name of the child to delete.public String toString()
toString
in class Object
public void init()
init
in interface EntityAdapter
public T getFileSystemAdapter()
EntityAdapter
FileSystemAdapter
for the file system where the entity
is.
getFileSystemAdapter
in interface EntityAdapter
FileSystemAdapter
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |