|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.uva.vlet.vrs.VNode
public abstract class VNode
The VNode class, the super class of all resource Nodes in the VRS package. It can be seen as a handler object, for example a reference to a (remote) file or directory.
VFSNode
,
VFile
,
VDir
Field Summary | |
---|---|
static java.lang.String |
ATTR_CHARSET
|
static java.lang.String |
ATTR_HOSTNAME
|
static java.lang.String |
ATTR_ICON
|
static java.lang.String |
ATTR_ISVLINK
|
static java.lang.String |
ATTR_LOCATION
|
static java.lang.String |
ATTR_MIMETYPE
VAttribute name for the MimeType |
static java.lang.String |
ATTR_NAME
|
static java.lang.String |
ATTR_PATH
|
static java.lang.String |
ATTR_PORT
|
static java.lang.String |
ATTR_SCHEME
|
static java.lang.String |
ATTR_TYPE
|
protected VRL |
location
The URI Compatable VRL or which specified the resource location |
protected VRSContext |
vrsContext
The *NEW* VRSContext to ensure shared environments ! Is FINAL, once set it may never be changed. |
Constructor Summary | |
---|---|
VNode(VRSContext context,
VRL vrl)
Universal contructor. |
Method Summary | |
---|---|
int |
compareTo(VNode parent)
|
abstract boolean |
exists()
Whether this node (still) exists |
VAttribute |
getAttribute(java.lang.String name)
This is the single method a Node has to implement so that attributes can be fetched. |
java.lang.String[] |
getAttributeNames()
Get the names of the attributes this resource has |
VAttribute[] |
getAttributes()
Get all attributes defined by attributeNames |
VAttribute[] |
getAttributes(java.lang.String[] names)
Get all attributes defined by names .Elements in the names array may be null!
It means do not fetch the attribute. |
VAttributeSet |
getAttributeSet(java.lang.String[] names)
Same as getAttributes(), but return the attributes in an Attribute set. |
java.lang.String |
getBasename()
Returns basename part of the path of a node. |
java.lang.String |
getCharSet()
Default charset for text resources |
VRL |
getHelp()
Returns simple text file or complete HTML page. |
java.lang.String |
getHostname()
Returns Hostname |
java.lang.String |
getIconURL()
Returns optional icon url |
long |
getID()
Get unique VNode id. |
VRL |
getLocation()
See getVRL() |
java.lang.String |
getMimeType()
Returns Mime Type based upon file filenam/extension. |
java.lang.String |
getName()
Returns the short name of the resource. The default is the basename of the resource or the last part of the path part in the URI. |
VNode |
getParent()
Get Parent Node (if any). In the case of a graph, this method might return null, if it has multiple parents and no parent (of the multiparents) can be considered as the 'master' or 'root' parent. |
VNode[] |
getParents()
Get Parents if the Node is part of a Graph. |
java.lang.String |
getPath()
Returns logical path of this resource |
int |
getPort()
Returns Port. |
java.lang.String |
getScheme()
|
VAttribute[] |
getServerAttributes()
This method return certain server properties which are used/needed to connect to the remote resource. |
abstract java.lang.String |
getType()
Returns resource type, if it has one |
java.net.URI |
getURI()
Returns URI (java.net.URI) of this object. |
VRL |
getVRL()
Returns Virtual Resource Locator (VRL) of this object. |
VRSContext |
getVRSContext()
Returns VRSContext which whas used to create this node |
boolean |
isComposite()
Highlevel method to check whether the node has the VComposite interface |
boolean |
isVirtual()
New Generic Type for MyVLe and LinkNodes |
boolean |
isVLink()
Returns true if the EXTENSION equals '.vlink', this node might not be of type LinkNode. |
VAttribute[] |
mergedGetAttributes(VAttributeSet attrSet,
java.lang.String[] attrNames)
Fetch atrributes which are not in the Attribute Set. |
protected void |
setLocation(VRL loc)
|
protected void |
setVRL(VRL loc)
Only subclasses may change the location. |
ResourceNode |
toLinkNode()
If this VNode represents a ResourceNode implementation this method will load the ResourceNode and return a new ResourceNode |
java.lang.String |
toString()
Return this node's location as String representation. Note that special characters are not encoded. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ATTR_TYPE
public static final java.lang.String ATTR_NAME
public static final java.lang.String ATTR_HOSTNAME
public static final java.lang.String ATTR_PORT
public static final java.lang.String ATTR_LOCATION
public static final java.lang.String ATTR_PATH
public static final java.lang.String ATTR_ICON
public static final java.lang.String ATTR_ISVLINK
public static final java.lang.String ATTR_MIMETYPE
public static final java.lang.String ATTR_CHARSET
public static final java.lang.String ATTR_SCHEME
protected VRL location
protected final VRSContext vrsContext
Constructor Detail |
---|
public VNode(VRSContext context, VRL vrl)
Method Detail |
---|
public final VRL getLocation()
getVRL()
public final VRSContext getVRSContext()
public final VRL getVRL()
VRL
,
URI
public final java.net.URI getURI() throws VlException
VlException
VRL
,
URI
public long getID()
public java.lang.String getName()
public java.lang.String getPath()
public java.lang.String getHostname()
public int getPort()
public java.lang.String getBasename()
public java.lang.String getMimeType() throws VlIOException
VlIOException
MimeTypes.getMagicMimeType(byte[])
,
MimeTypes.getMimeType(String)
public java.lang.String getCharSet() throws VlIOException
VlIOException
public boolean isComposite()
public java.lang.String[] getAttributeNames()
public VAttribute[] getAttributes() throws VlException
VlException
VlException
public VAttribute[] getAttributes(java.lang.String[] names) throws VlException
names
.names
array may be null!
It means do not fetch the attribute.
This is to speed up fetching of indexed attributes.
VlException
public VAttributeSet getAttributeSet(java.lang.String[] names) throws VlException
names
-
VlException
public VAttribute[] mergedGetAttributes(VAttributeSet attrSet, java.lang.String[] attrNames) throws VlException
attrSet
- attrNames
-
VlException
public VAttribute getAttribute(java.lang.String name) throws VlException
VlException
public java.lang.String toString()
toString
in class java.lang.Object
protected void setLocation(VRL loc)
setVRL(VRL loc)
protected void setVRL(VRL loc)
public boolean isVLink()
LinkNode
,
toLinkNode()
public int compareTo(VNode parent)
public ResourceNode toLinkNode() throws VlException
VlException
public VAttribute[] getServerAttributes()
public java.lang.String getIconURL()
public VRL getHelp()
public VNode getParent() throws VlException
VlException
getParents()
public VNode[] getParents() throws VlException
VlException
public java.lang.String getScheme()
public boolean isVirtual()
public abstract java.lang.String getType()
public abstract boolean exists() throws VlException
VlException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |