fi.hut.tml.xsmiles
Class XLink

java.lang.Object
  extended byfi.hut.tml.xsmiles.XLink
Direct Known Subclasses:
XLinkWithContent

public class XLink
extends java.lang.Object

Contains the data in an XLink and the functions required for the XPointer fragments.

Version:
$Revision: 5988 $
Author:
Jukka Heinonen

Field Summary
static int FAKE_WITH_CONTENT
           
static java.lang.String FILEURLPREFIX
           
protected  int m_method
           
static int POST
           
static int POST_FORMDATA_HTTP
           
static int POST_HTTP
           
static int POST_JMS
           
static int POST_MULTIPART_HTTP
           
static int POST_URLENCODED_HTTP
           
static int PUT_HTTP
           
static int SIMPLE
           
 
Constructor Summary
XLink(java.lang.String url)
           
XLink(java.lang.String url, int linkType)
          The constructor of the XLink object.
XLink(java.net.URL url)
          Initializes XLink with URL parameter.
XLink(java.net.URL url, byte[] data, int method, java.util.Hashtable properties)
          Initializes XLink with POST data.
XLink(java.net.URL url, java.lang.String data, int method, java.util.Hashtable properties)
          Initializes XLink with POST data.
 
Method Summary
 java.io.InputStream getContent()
          this may be implemented by subclasses, if they want to hold the content in themselves
 java.lang.String getContentType()
           
 int getLinkType()
           
 int getMethod()
           
 java.lang.String getMIMEOverride()
          some XLinks may want to override the MIME type gotten from the URL connection.
 byte[] getPostData()
           
 java.util.Hashtable getProperties()
           
 java.net.URL getURL()
          Accessor method.
 java.lang.String getURLString()
           
 void removePostData()
           
 void setMIMEOverride(java.lang.String override)
          some XLinks may want to override the MIME type gotten from the URL connection.
 void setURL(java.net.URL url)
          Set the URL, for example after a redirect has happened
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIMPLE

public static final int SIMPLE
See Also:
Constant Field Values

POST

public static final int POST
See Also:
Constant Field Values

FAKE_WITH_CONTENT

public static final int FAKE_WITH_CONTENT
See Also:
Constant Field Values

FILEURLPREFIX

public static final java.lang.String FILEURLPREFIX

POST_HTTP

public static final int POST_HTTP
See Also:
Constant Field Values

POST_JMS

public static final int POST_JMS
See Also:
Constant Field Values

POST_URLENCODED_HTTP

public static final int POST_URLENCODED_HTTP
See Also:
Constant Field Values

POST_FORMDATA_HTTP

public static final int POST_FORMDATA_HTTP
See Also:
Constant Field Values

POST_MULTIPART_HTTP

public static final int POST_MULTIPART_HTTP
See Also:
Constant Field Values

PUT_HTTP

public static final int PUT_HTTP
See Also:
Constant Field Values

m_method

protected int m_method
Constructor Detail

XLink

public XLink(java.lang.String url,
             int linkType)
The constructor of the XLink object.

Parameters:
url - a String that contains the URL the link points to.
linkType - The type of the link, an enumerated type (e.g. 1 means "SIMPLE")

XLink

public XLink(java.lang.String url)

XLink

public XLink(java.net.URL url)
Initializes XLink with URL parameter. Link type is set SIMPLE.

Parameters:
url - URL to be assigned to XLink

XLink

public XLink(java.net.URL url,
             java.lang.String data,
             int method,
             java.util.Hashtable properties)
Initializes XLink with POST data. Link type is set POST.

Parameters:
method - Can be either XLink.POST_HTTP or POST_JMS

XLink

public XLink(java.net.URL url,
             byte[] data,
             int method,
             java.util.Hashtable properties)
Initializes XLink with POST data. Link type is set POST.

Parameters:
method - Can be either XLink.POST_HTTP or POST_JMS
Method Detail

getMIMEOverride

public java.lang.String getMIMEOverride()
some XLinks may want to override the MIME type gotten from the URL connection. if this is null, then no overriding is used


setMIMEOverride

public void setMIMEOverride(java.lang.String override)
some XLinks may want to override the MIME type gotten from the URL connection. if this is null, then no overriding is used


getURL

public java.net.URL getURL()
Accessor method.

Returns:
url the URL of the link.

setURL

public void setURL(java.net.URL url)
Set the URL, for example after a redirect has happened


getURLString

public java.lang.String getURLString()

getLinkType

public int getLinkType()

getMethod

public int getMethod()

getPostData

public byte[] getPostData()

removePostData

public void removePostData()

getProperties

public java.util.Hashtable getProperties()

getContentType

public java.lang.String getContentType()

getContent

public java.io.InputStream getContent()
this may be implemented by subclasses, if they want to hold the content in themselves



X-Smiles 1.2