|
|||||||||
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 implements 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 |
RELATIONSHIP_ANY, RELATIONSHIP_CHILD, RELATIONSHIP_CHILD_OR_ABSOLUTE, 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 |
getFullName(Url url)
Returns a full name for the Url, typically consisting of the "file" entry with any other annotation necessary to clarify the nature of the path. |
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,
int relationship)
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. |
boolean |
setLastModified(Url url,
long lastModified)
Changes the last modification timestamp reported for a particular resource. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.borland.primetime.vfs.Filesystem |
delete, exists, getChildren, getInputStream, getLastModified, getOutputStream, getOutputStream, getProtocol, isDirectory, isReadOnly |
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)
getChild
in interface Filesystem
url
- The existing Url.subpath
- The subpath to be added to the Url's file path.public Url getParent(Url url)
getParent
in interface Filesystem
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.getFileObject
in interface Filesystem
url
- The Url in question.public Url getCanonicalUrl(Url url)
getCanonicalUrl
in interface Filesystem
url
- The Url in question.public boolean isValid(Url url)
isValid
in interface Filesystem
url
- The Url in question.public int fileHashCode(Url url)
fileEquals
.fileHashCode
in interface Filesystem
url
- The Url to produce a hash value based on.public boolean fileEquals(Url url, Url otherUrl)
fileEquals
in interface Filesystem
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)
getName
in interface Filesystem
public java.lang.String getFullName(Url url)
getFullName
in interface Filesystem
public Url getRelativeUrl(Url root, java.lang.String relativePath)
getRelativeUrl
in interface Filesystem
root
- The Url root.relativePath
- The relative path from the root.public java.lang.String getRelativePath(Url root, Url target, int relationship)
getRelativePath
in interface Filesystem
root
- The Url root.target
- The Url target.relationship
- One of the Filesystem.RELATIONSHIP_ constants.public boolean setLastModified(Url url, long lastModified)
setLastModified
in interface Filesystem
url
- The resource to be changed.lastModified
- The new timestamp to be used.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |