|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.cap.symlink.util.DCSymbolicLinkUtil
public final class DCSymbolicLinkUtil
This utility class contains static methods for working with Directory
:s that support the DCSymbolicLink
capability.
The methods in this class will use the locking strategy for utility classes
described in EntityLock
.
Method Summary | |
---|---|
static DCSymbolicLink |
getCapability(DirectoryView dv)
Get the DCSymbolicLink capability for a directory. |
static SymbolicLinkView |
getSymbolicLink(EntityHolder eh,
RelativeLocation rl)
Get the symbolic link with the given location relative to the entity holder. |
static SymbolicLinkView |
getSymbolicLink(EntityHolder eh,
String name)
Get the symbolic link with the given name from an entity holder. |
static SymbolicLinkView |
getSymbolicLinkOrNull(EntityHolder eh,
RelativeLocation rl)
Get an existing symbolic link with the given location relative to the entity holder, returning null if the symbolic link does not exist
or if it has been made invisible by view filters. |
static SymbolicLinkView |
getSymbolicLinkOrNull(EntityHolder eh,
String name)
Get an existing symbolic link from the holder, returning null if
the symbolic link does not exist or if it has been made invisible by view
filters. |
static SymbolicLinkView |
newAbsoluteSymbolicLink(EntityAcceptingEntityView<?> parent,
String name,
EntityView target)
Create a new absolute symbolic link pointing to the current location of the supplied entity. |
static SymbolicLinkView |
newRelativeSymbolicLink(EntityAcceptingEntityView<?> parent,
String name,
EntityView target)
Create a new relative symbolic link pointing to the current location of the supplied entity. |
static SymbolicLinkView |
newSymbolicLink(EntityAcceptingEntityView<?> parent,
String name,
EntityLocation<?> target)
Create a new symbolic link in the directory. |
static boolean |
supportsSymbolicLinks(DirectoryView dv)
Check if the directory supports the DCSymbolicLink capability. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static SymbolicLinkView newSymbolicLink(EntityAcceptingEntityView<?> parent, String name, EntityLocation<?> target) throws NotADirectoryException, UnsupportedCapabilityException
Entity locks that this method will acquire (temporarily):
parent
- An entity-accepting entity that can be dereferenced to the
directory where the symbolic link will be created.name
- The name of the symbolic link.target
- The symbolic link target. The target can be a
RelativeLocation
or an AbsoluteLocation
.
NotADirectoryException
- If the parent argument cannot be
dereferenced to a directory.
UnsupportedCapabilityException
- If the parent directory does not
support the DCSymbolicLink
capability.public static SymbolicLinkView newRelativeSymbolicLink(EntityAcceptingEntityView<?> parent, String name, EntityView target) throws NotADirectoryException, UnsupportedCapabilityException
Entity locks that this method will acquire (temporarily):
parent
- An entity-accepting entity that can be dereferenced to the
directory where the symbolic link will be created.name
- The name of the symbolic link.target
- The entity that will be referenced by the created relative
symbolic link.
NotADirectoryException
- If the parent argument cannot be
dereferenced to a directory.
UnsupportedCapabilityException
- If the parent directory does not
support the DCSymbolicLink
capability.public static SymbolicLinkView newAbsoluteSymbolicLink(EntityAcceptingEntityView<?> parent, String name, EntityView target) throws NotADirectoryException, UnsupportedCapabilityException
Entity locks that this method will acquire (temporarily):
parent
- An entity-accepting entity that can be dereferenced to the
directory where the symbolic link will be created.name
- The name of the symbolic link.target
- The entity that will be referenced by the created absolute
symbolic link.
NotADirectoryException
- If the parent argument cannot be
dereferenced to a directory.
UnsupportedCapabilityException
- If the parent directory does not
support the DCSymbolicLink
capability.public static SymbolicLinkView getSymbolicLink(EntityHolder eh, String name) throws EntityNotFoundException, AccessDeniedException, NotASymbolicLinkException
eh
- The entity holder containing the symbolic link.name
-
EntityNotFoundException
- If no entity with the supplied name
exists in the directory.
AccessDeniedException
- If the calling thread lacks proper access
rights.
NotASymbolicLinkException
- If an entity with the supplied name was
found, but it was not a symbolic link.public static SymbolicLinkView getSymbolicLink(EntityHolder eh, RelativeLocation rl) throws EntityNotFoundException, AccessDeniedException, NotASymbolicLinkException, IllegalArgumentException
If this method is called with a SymbolicLink
argument, the result
can safely be cast to SymbolicLink
.
eh
- The entity holder, for instance a directory or directory view.rl
- The relative location of the symbolic link compared with the
holder's. If this is called on a non-entity holder, this location cannot
reference the holder or a location above the holder.
EntityNotFoundException
- If the symbolic link does not exist or if
it has been made invisible by view filters.
AccessDeniedException
- If the client does not have execute access
to the entity holder.
NotASymbolicLinkException
- If the found entity is not a symbolic
link.
IllegalArgumentException
- If this is called with a location that
references a non-entity entity holder or a location above an entity
holder, i.e. an entity holder that does not implement EntityView
.
(Referencing entities or parents of entities are allowed.)public static SymbolicLinkView getSymbolicLinkOrNull(EntityHolder eh, String name) throws AccessDeniedException, NotASymbolicLinkException
null
if
the symbolic link does not exist or if it has been made invisible by view
filters.
If this is called with a directory view argument, a symbolic link view that is identical to the supplied directory view (same filter instances) is returned.
eh
- The entity holder, for instance a directory or directory view.name
- The name of the symbolic link.
null
if it does not exist or if it
has been made invisible by view filters.
AccessDeniedException
- If the client does not have execute access
to the entity holder.
NotASymbolicLinkException
- If the entity exists but is not a
symbolic link.public static SymbolicLinkView getSymbolicLinkOrNull(EntityHolder eh, RelativeLocation rl) throws AccessDeniedException, NotASymbolicLinkException, IllegalArgumentException
null
if the symbolic link does not exist
or if it has been made invisible by view filters.
If this method is called with a directory view argument, the returned symbolic link is an identical (same filter instances) view of the requested symbolic link.
eh
- The entity holder, for instance a directory or directory view.rl
- The relative location of the symbolic link compared with the
holder's. If this is called on a non-entity holder, this location cannot
reference the holder or a location above the holder.
null
if it does not exist or has
been made invisible by view filters.
AccessDeniedException
- If the client does not have execute access
to directories needed to find the target entity.
NotASymbolicLinkException
- If the entity exists but is not a
symbolic link.
IllegalArgumentException
- If this is called with a location that
references a non-entity entity holder or a location above an entity
holder, i.e. an entity holder that does not implement EntityView
.
(Referencing entities or parents of entities are allowed.)public static DCSymbolicLink getCapability(DirectoryView dv) throws UnsupportedCapabilityException
DCSymbolicLink
capability for a directory.
dv
- The directory to get the capability for.
UnsupportedCapabilityException
- If the directory does not support
the capability.public static boolean supportsSymbolicLinks(DirectoryView dv)
DCSymbolicLink
capability.
dv
- The directory to investigate.
true
if the directory supports the capability, false
otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |