|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.cap.metadata.util.ECNamedMetadataUtil
public final class ECNamedMetadataUtil
This utility class contains static methods for working with entities that
support the ECNamedMetadata
capability.
The methods in this class will use the locking strategy for utility classes
described in EntityLock
.
ECMetadataUtil
Method Summary | |
---|---|
static void |
deleteMetadataFile(EntityView ev,
String name)
Delete the metadata file for the entity. |
static ECNamedMetadata |
getCapability(EntityView ev)
Get the ECNamedMetadata capability for an entity. |
static ReadWritableFile |
getMetadataFile(EntityView ev,
String name)
Get the named metadata file for the entity. |
static Set<String> |
getMetadataFileNames(EntityView ev)
Get all metadata file names for the entity. |
static boolean |
hasMetadataFile(EntityView ev,
String name)
Check if the entity has a metadata file with the given name. |
static ReadWritableFile |
newMetadataFile(EntityView ev,
String name)
Create a new metadata file for the entity. |
static boolean |
supportsMetadata(EntityView ev)
Check if the entity supports the ECNamedMetadata capability. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ECNamedMetadata getCapability(EntityView ev) throws UnsupportedCapabilityException
ECNamedMetadata
capability for an entity.
ev
- The entity to get the capability for.
UnsupportedCapabilityException
- If the entity does not support the
ECNamedMetadata
capability.public static boolean supportsMetadata(EntityView ev)
ECNamedMetadata
capability.
ev
- The entity to investigate.
true
if the entity supports the capability, false
otherwise.public static Set<String> getMetadataFileNames(EntityView ev) throws UnsupportedCapabilityException
The returned set is a read only view of the internal file name set, so updates in that set (by metadata files being created or deleted), are reflected in the set that is returned by this method.
This method will lock the entity for reading while executing.
ev
- The entity.
UnsupportedCapabilityException
- If the entity does not support the
ECNamedMetadata
capability.ECNamedMetadata.getMetadataFileNames()
public static boolean hasMetadataFile(EntityView ev, String name) throws UnsupportedCapabilityException
This method will lock the entity for reading while executing.
ev
- The entity to investigate.name
- The name of the metadata file.
true
if the entity has a metadata file of the given name,
false
if not.
UnsupportedCapabilityException
- If the entity does not support the
ECNamedMetadata
capability.ECNamedMetadata.hasMetadataFile(String)
public static ReadWritableFile getMetadataFile(EntityView ev, String name) throws EntityNotFoundException, UnsupportedCapabilityException
This method will lock the entity for reading while executing.
ev
- The entity.name
- The name of the metadata file. This must be a valid file name
in the backing file system.
EntityNotFoundException
- If the entity does not have a metadata
file with the supplied name.
UnsupportedCapabilityException
- If the entity does not support the
ECNamedMetadata
capability.ECNamedMetadata.getMetadataFile(String)
public static ReadWritableFile newMetadataFile(EntityView ev, String name) throws EntityFoundException, ReadOnlyException, UnsupportedCapabilityException
This method will lock the entity for writing while executing.
ev
- The entity.name
- The name of the metadata file. This must be a valid file name
in the backing file system.
EntityFoundException
- If the entity already has a metadata file
with the supplied name.
ReadOnlyException
- If the file system is read only.
UnsupportedCapabilityException
- If the entity does not support the
ECNamedMetadata
capability.ECNamedMetadata.newMetadataFile(String)
public static void deleteMetadataFile(EntityView ev, String name) throws EntityNotFoundException, ReadOnlyException, UnsupportedCapabilityException
This method will lock the entity for writing while executing.
ev
- The entity.name
- The name of the metadata file to delete.
EntityNotFoundException
- If no such metadata file exists.
ReadOnlyException
- If the file system is read only.
UnsupportedCapabilityException
- If the entity does not support the
ECNamedMetadata
capability.ECNamedMetadata.deleteMetadataFile(String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |