|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.primetime.vfs.AbstractFilesystem
AbstractFilesystem is an abstract class that implementats a subset of the
Filesystem interface that should be fairly consistent from one filesystem
to the next. Standardized support for hashing, Url comparison and evaluating
relative paths is included. The latter may be customized by overriding some
or all of getChild
, getParent
,
getAbsoluteUrl
, and getRelativeUrl
.
Filesystem
Fields inherited from interface com.borland.primetime.vfs.Filesystem |
TYPE_BOTH,
TYPE_DIRECTORY,
TYPE_FILE |
Constructor Summary | |
AbstractFilesystem()
|
Method Summary | |
boolean |
fileEquals(Url url,
Url otherUrl)
Compares the file portion of two Url objects in a case sensitive manner. |
int |
fileHashCode(Url url)
Produces a hash value for the file portion of a Url compatible with the definition of equality provided by fileEquals . |
protected Url |
getAbsoluteUrl(java.lang.String newHost,
java.lang.String absoluteFilePath)
Assists in interpreting a relative path by creating a full Url for a file path if it represents an absolute path. |
Url |
getCanonicalUrl(Url url)
Reports the exact Url representation of a resource. |
Url |
getChild(Url url,
java.lang.String subpath)
Creates a new Url that adds the specified subpath to an existing Url's file path. |
java.io.File |
getFileObject(Url url)
Describes a Url in terms of a java.io.File instance. |
java.lang.String |
getName(Url url)
Returns a short name for the Url. |
Url |
getParent(Url url)
Returns a Url with the last subpath from the supplied Url's file path removed. |
java.lang.String |
getRelativePath(Url root,
Url target,
boolean onlyChildren)
Create a relative path from an root Url to specified target Url. |
Url |
getRelativeUrl(Url root,
java.lang.String relativePath)
Create a new Url from an existing root Url and a relative component. |
boolean |
isValid(Url url)
Determines whether the state of a Url instance is valid. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public AbstractFilesystem()
Method Detail |
protected Url getAbsoluteUrl(java.lang.String newHost, java.lang.String absoluteFilePath)
public Url getChild(Url url, java.lang.String subpath)
url
- The existing Url.subpath
- The subpath to be added to the Url's file path.public Url getParent(Url url)
url
- The Url for which a parent is desired.public java.io.File getFileObject(Url url)
java.io.File
instance. Note
that this may not be appropriate for many filesystem types, and will
return null in these cases.url
- The Url in question.public Url getCanonicalUrl(Url url)
url
- The Url in question.public boolean isValid(Url url)
url
- The Url in question.public int fileHashCode(Url url)
fileEquals
.url
- The Url to produce a hash value based on.public boolean fileEquals(Url url, Url otherUrl)
url
- The first of the two Urls to be compared.otherUrl
- The second of the two Urls to be compared.public java.lang.String getName(Url url)
public Url getRelativeUrl(Url root, java.lang.String relativePath)
root
- The Url root.relativePath
- The relative path from the root.public java.lang.String getRelativePath(Url root, Url target, boolean onlyChildren)
root
- The Url root.target
- The Url target.onlyChildren
- True if the target must be a descendant of the root,
false if absolute paths and paths with leading "../" entries should be
considered.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |