org.entityfs.cap.entityattrs.util
Class ECEntityAttributesUtil

java.lang.Object
  extended by org.entityfs.cap.entityattrs.util.ECEntityAttributesUtil

public final class ECEntityAttributesUtil
extends Object

This is a static utility class for working with ECEntityAttributes capable entities.

Since:
1.0
Author:
Karl Gustafsson
See Also:
ECNtfsAttributesUtil, ECUnixAttributesUtil
In_jar:
entityfs-entity_attributes

Method Summary
static EntityAttributes getAttributes(EntityView ev)
          Get entity attributes for an entity.
static ECEntityAttributes<?> getCapability(EntityView ev)
          Get the ECEntityAttributes capability for an entity.
static
<T extends EntityAttributes>
void
setAttributes(EntityView ev, T attr)
          Set the entity attributes for an entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCapability

public static ECEntityAttributes<?> getCapability(EntityView ev)
                                           throws UnsupportedCapabilityException
Get the ECEntityAttributes capability for an entity.

Some implementations do not support entity attributes for all entities in a file system. Often, the root directory is not supported.

Parameters:
ev - The entity.
Returns:
The capability.
Throws:
UnsupportedCapabilityException - If the entity does not support the ECEntityAttributes capability.

getAttributes

public static EntityAttributes getAttributes(EntityView ev)
                                      throws UnsupportedCapabilityException,
                                             AccessDeniedException
Get entity attributes for an entity.

This method temporarily acquires a read lock on the entity's parent directory.

Parameters:
ev - The entity to get the attributes for.
Returns:
The entity attributes for the entity.
Throws:
UnsupportedCapabilityException - If the entity does not support the ECEntityAttributes capability.
AccessDeniedException - If the client does not have read access to the entity's parent directory.
Permissions_required:
Execute access to the entity's parent directory.

setAttributes

public static <T extends EntityAttributes> void setAttributes(EntityView ev,
                                                              T attr)
                          throws UnsupportedCapabilityException,
                                 AccessDeniedException,
                                 ReadOnlyException
Set the entity attributes for an entity.

This method temporarily acquires a write lock on the entity's parent directory.

Parameters:
ev - The entity to set the attributes for.
attr - The attributes.
Throws:
UnsupportedCapabilityException - If the entity does not support the ECEntityAttributes capability.
AccessDeniedException - If the client does not have write access to the entity's parent directory.
ReadOnlyException - If the file system is read only.
Permissions_required:
Write and execute access to the entity's parent directory.