to.etc.domui.util.resources
Class WebappResourceRef

java.lang.Object
  extended by to.etc.domui.util.resources.WebappResourceRef
All Implemented Interfaces:
IModifyableResource, IResourceRef

public class WebappResourceRef
extends java.lang.Object
implements IResourceRef, IModifyableResource

A full reference to a web app file (a file somewhere in the webapp's web files or WEB-INF directorty).

Author:
Frits Jalvingh Created on Oct 19, 2009

Constructor Summary
WebappResourceRef(java.io.File resource)
           
 
Method Summary
 boolean exists()
          Return T if this resource actually exists.
 java.io.InputStream getInputStream()
          Returns the input stream for the resource.
 long getLastModified()
          Return the current last modification time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebappResourceRef

public WebappResourceRef(@Nonnull
                         java.io.File resource)
Method Detail

exists

public boolean exists()
Description copied from interface: IResourceRef
Return T if this resource actually exists.

Specified by:
exists in interface IResourceRef
Returns:

getLastModified

public long getLastModified()
Description copied from interface: IModifyableResource
Return the current last modification time. This must return the ACTUAL modification time of the resource; the time returned by this call will be compared with the time that the resource was last used (stored somewhere else) to decide if this resource has changed in the meantime. This call must return -1 for a resource that does not exist - because non-existence is a valid caching criteria too!

Specified by:
getLastModified in interface IModifyableResource
Returns:

getInputStream

@Nonnull
public java.io.InputStream getInputStream()
                                   throws java.lang.Exception
Description copied from interface: IResourceRef
Returns the input stream for the resource. This will return a new stream for every call. It returns null if the resource does not exist.

Specified by:
getInputStream in interface IResourceRef
Returns:
Throws:
java.lang.Exception