org.entityfs.util.cap.fs
Class FSCUriResolvableUtil

java.lang.Object
  extended by org.entityfs.util.cap.fs.FSCUriResolvableUtil

public final class FSCUriResolvableUtil
extends Object

This utility class contains static methods for working with file systems that support the FSCUriResolvable file system capability.

Since:
1.0
Author:
Karl Gustafsson
See Also:
FSCUriResolvable

Method Summary
static Entity getEntityForUri(FileSystem fs, URI u)
          Get the entity in the file system that is referenced by the supplied java.net.URI.
static AbsoluteLocation getEntityLocationForUri(FileSystem fs, URI u)
          Get the absolute entity location in the file system that is referenced by the supplied java.net.URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getEntityLocationForUri

public static AbsoluteLocation getEntityLocationForUri(FileSystem fs,
                                                       URI u)
                                                throws UnsupportedCapabilityException,
                                                       EntityNotFoundException
Get the absolute entity location in the file system that is referenced by the supplied java.net.URI.

Parameters:
fs - The file system.
u - The URI.
Returns:
The absolute entity location for the location referenced by the URI.
Throws:
UnsupportedCapabilityException - If the file system does not support the FSCUriResolvable capability.
EntityNotFoundException - If the URI does not reference a location within the file system.
Permissions_required:
None

getEntityForUri

public static Entity getEntityForUri(FileSystem fs,
                                     URI u)
                              throws UnsupportedCapabilityException,
                                     EntityNotFoundException
Get the entity in the file system that is referenced by the supplied java.net.URI.

This method will temporarily acquire read locks on all entities from the file system's root directory to the requested entity's parent directory.

Parameters:
fs - The file system.
u - The URI.
Returns:
The entity referenced by the URI.
Throws:
UnsupportedCapabilityException - If the file system does not support the FSCUriResolvable capability.
EntityNotFoundException - If the URI does not reference an entity within the file system.
Permissions_required:
Execute access to all directories between the file system's root directory and the requested entity's parent directory.