org.sapia.resource
Class StringResource

java.lang.Object
  extended by org.sapia.resource.StringResource
All Implemented Interfaces:
Resource

public class StringResource
extends java.lang.Object
implements Resource

Implements the Resource interface over a string.

Author:
Yanick Duchesne

Constructor Summary
StringResource(java.lang.String uri, java.lang.String str)
           
 
Method Summary
 java.io.InputStream getInputStream()
           
 Resource getRelative(java.lang.String uri)
          This method throws an UnsupportedOperationException.
 java.lang.String getURI()
           
 long lastModified()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringResource

public StringResource(java.lang.String uri,
                      java.lang.String str)
Method Detail

lastModified

public long lastModified()
Specified by:
lastModified in interface Resource
Returns:
the time, in millis, at which this resource was last modified.

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Specified by:
getInputStream in interface Resource
Returns:
the InputStream corresponding to this resource.
Throws:
java.io.IOException

getURI

public java.lang.String getURI()
Specified by:
getURI in interface Resource
Returns:
the URI that this resource corresponds to.

getRelative

public Resource getRelative(java.lang.String uri)
                     throws java.io.IOException
This method throws an UnsupportedOperationException.

Specified by:
getRelative in interface Resource
Parameters:
uri - a URI.
Returns:
the Resource corresponding to the given relative URI.
Throws:
java.io.IOException


Copyright © 2011 Sapia OSS. All Rights Reserved.