org.jicengine.io
Class UrlResource

java.lang.Object
  extended byorg.jicengine.io.AbstractResource
      extended byorg.jicengine.io.UrlResource
All Implemented Interfaces:
Resource, UrlReadable

public class UrlResource
extends AbstractResource
implements UrlReadable

A resource that is read through an Url.

Version:
1.0
Author:
.timo

Constructor Summary
UrlResource(java.net.URL url)
           
 
Method Summary
 java.io.InputStream getInputStream()
          A primary way reading the resource.
 Resource getResource(java.lang.String relativePath)
           Locates another Resource whose path is defined relative to this Resource.
 java.net.URL getUrl()
           
 
Methods inherited from class org.jicengine.io.AbstractResource
getIdentifier, getMimeType, getReader, isAvailable, setMimeType, toString, writeTo, writeTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UrlResource

public UrlResource(java.net.URL url)
Method Detail

getUrl

public java.net.URL getUrl()
Specified by:
getUrl in interface UrlReadable

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Description copied from interface: Resource
A primary way reading the resource.

Specified by:
getInputStream in interface Resource
Specified by:
getInputStream in class AbstractResource
Throws:
java.io.IOException

getResource

public Resource getResource(java.lang.String relativePath)
                     throws java.io.IOException
Description copied from interface: Resource

Locates another Resource whose path is defined relative to this Resource.

the path scheme used with files and urls is used for specifying relative paths.

the method generally returns instances of the same Resource-subclass than the current instance, but this is not obligatory.

NOTE:

NOTE: there is no support for absolute paths. yet.

Specified by:
getResource in interface Resource
Specified by:
getResource in class AbstractResource
Throws:
java.io.IOException