|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.el.AbstractLocation<AbsoluteLocation>
org.entityfs.el.AbsoluteLocation
public class AbsoluteLocation
Objects of this class describe absolute entity locations in a file system, i.e. an entity location that defines an entity's absolute position in the file system hierarchy. (An absolute path.)
A word of warning: Be careful with using absolute entity locations in locking file systems that are concurrently accessed by several threads. Creating an absolute entity location requires read locking all parent entities up to the file system root. Use relative entity locations as much as possible instead.
Instances of this class are immutable.
Field Summary | |
---|---|
static AbsoluteLocation |
ROOT_DIR
A constant representing the root directory ( / ). |
Fields inherited from interface org.entityfs.el.EntityLocation |
---|
CURRENT_DIRECTORY_STRING, EXTENSION_SEPARATOR, PARENT_DIRECTORY_STRING, SEPARATOR, SEPARATOR_CHAR |
Constructor Summary | |
---|---|
AbsoluteLocation(String apath)
Create a new AbsoluteLocation instance. |
Method Summary | |
---|---|
int |
compareTo(AbsoluteLocation el)
|
AbsoluteLocation |
getChildLocation(String name)
Get the location of the named child entity relative to this location. |
String |
getLocation()
Get a string representation of the entity location. |
AbsoluteLocation |
getLocation(RelativeLocation loc)
Get the location of this entity location combined with the given relative location, represented by the same entity location type as this entity location. |
AbsoluteLocation |
getParentLocation()
Get the parent location of this entity location. |
RelativeLocation |
getRelativeTo(AbsoluteLocation el)
|
boolean |
isInPathOf(AbsoluteLocation el)
|
String |
toString()
|
Methods inherited from class org.entityfs.el.AbstractLocation |
---|
equals, getBaseName, getExtension, getName, getPathSegmentStack, hashCode, isRootDir |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final AbsoluteLocation ROOT_DIR
/
).
Constructor Detail |
---|
public AbsoluteLocation(String apath) throws IllegalArgumentException, InvalidEntityLocationException
AbsoluteLocation
instance.
apath
- The string representation of an absolute path in the file
system. The path is normalized by this method.
IllegalArgumentException
- If apath
is not a valid absolute
path.
InvalidEntityLocationException
- If the path is not within the file
system (For instance, /..
)Method Detail |
---|
public String getLocation()
EntityLocation
This always holds: new ELT(s).equals(new ELT(new
ELT(s).getLocation())) == true
for all valid entity location strings
s
and concrete entity location classes ELT
.
getLocation
in interface EntityLocation<AbsoluteLocation>
public boolean isInPathOf(AbsoluteLocation el)
public AbsoluteLocation getParentLocation()
EntityLocation
getParentLocation
in interface EntityLocation<AbsoluteLocation>
public RelativeLocation getRelativeTo(AbsoluteLocation el)
public AbsoluteLocation getChildLocation(String name)
EntityLocation
getChildLocation
in interface EntityLocation<AbsoluteLocation>
name
- The child entity name.
public AbsoluteLocation getLocation(RelativeLocation loc)
EntityLocation
getLocation
in interface EntityLocation<AbsoluteLocation>
loc
- The location relative to this entity location.
public int compareTo(AbsoluteLocation el)
compareTo
in interface Comparable<AbsoluteLocation>
public String toString()
toString
in class AbstractLocation<AbsoluteLocation>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |