nl.uva.vlet.vrs.http
Class HTTPNode

java.lang.Object
  extended by nl.uva.vlet.vrs.VNode
      extended by nl.uva.vlet.vrs.http.HTTPNode
All Implemented Interfaces:
VStreamReadable

public class HTTPNode
extends VNode
implements VStreamReadable

Class represents a HTTP reference


Field Summary
 
Fields inherited from class nl.uva.vlet.vrs.VNode
ATTR_CHARSET, ATTR_HOSTNAME, ATTR_ICON, ATTR_ISVLINK, ATTR_LOCATION, ATTR_MIMETYPE, ATTR_NAME, ATTR_PATH, ATTR_PORT, ATTR_SCHEME, ATTR_TYPE, location, vrsContext
 
Constructor Summary
HTTPNode(VRSContext context, VRL loc)
           
 
Method Summary
 boolean exists()
          Whether this node (still) exists
 java.lang.String[] getAttributeNames()
          Get the names of the attributes this resource has
 java.lang.String getCharSet()
          Get mimetype as reported by remote Server.
 VRL getHelp()
          Returns simple text file or complete HTML page.
 java.io.InputStream getInputStream()
          Create InputStream to read from this (remote) resource.
 java.lang.String getMimeType()
          Get mimetype as reported by remote Server.
 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 getType()
          Returns resource type, if it has one
 java.net.URL getURL()
           
 
Methods inherited from class nl.uva.vlet.vrs.VNode
compareTo, getAttribute, getAttributes, getAttributes, getAttributeSet, getBasename, getHostname, getIconURL, getID, getLocation, getName, getPath, getPort, getScheme, getServerAttributes, getURI, getVRL, getVRSContext, isComposite, isVirtual, isVLink, mergedGetAttributes, setLocation, setVRL, toLinkNode, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTTPNode

public HTTPNode(VRSContext context,
                VRL loc)
         throws VlException
Throws:
VlException
Method Detail

getType

public java.lang.String getType()
Description copied from class: VNode
Returns resource type, if it has one

Specified by:
getType in class VNode

getHelp

public VRL getHelp()
Description copied from class: VNode
Returns simple text file or complete HTML page. Method should point to installed documentation. Default is to return help about this type.

Overrides:
getHelp in class VNode

getParent

public VNode getParent()
                throws VlException
Description copied from class: VNode
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.

Overrides:
getParent in class VNode
Returns:
Parent VNode or null.
Throws:
VlException
See Also:
VNode.getParents()

getParents

public VNode[] getParents()
                   throws VlException
Description copied from class: VNode
Get Parents if the Node is part of a Graph.
Returns one parent if Node is part of a Tree or null if Node has no parents.

Overrides:
getParents in class VNode
Throws:
VlException

exists

public boolean exists()
Description copied from class: VNode
Whether this node (still) exists

Specified by:
exists in class VNode

getInputStream

public java.io.InputStream getInputStream()
                                   throws VlException
Description copied from interface: VStreamReadable
Create InputStream to read from this (remote) resource.

Note that not all protocols support 'partially' reading from a remote file. Currently both Jargon's SRB and Java's File type support Input and OutputStreams !

Specified by:
getInputStream in interface VStreamReadable
Returns:
java.io.InputStream object
Throws:
VlException
See Also:
InputStream

getMimeType

public java.lang.String getMimeType()
                             throws VlIOException
Get mimetype as reported by remote Server. returns url.openConnection().getContentEncoding();

Overrides:
getMimeType in class VNode
Throws:
VlIOException
See Also:
MimeTypes.getMagicMimeType(byte[]), MimeTypes.getMimeType(String)

getCharSet

public java.lang.String getCharSet()
                            throws VlIOException
Get mimetype as reported by remote Server. returns url.openConnection().getContentEncoding();

Overrides:
getCharSet in class VNode
Throws:
VlIOException

getAttributeNames

public java.lang.String[] getAttributeNames()
Get the names of the attributes this resource has

Overrides:
getAttributeNames in class VNode

getURL

public java.net.URL getURL()