public class Resource extends Object
| Constructor and Description |
|---|
Resource(String aName)
Creates a new Resource for its underlying in class path
|
Resource(String aName,
boolean aWatch)
Creates a new Resource for its underlying in class path
|
Resource(String aName,
ResourceLoader aResourceLoader,
boolean watch)
Creates a new Resource
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ResourceListener listener)
Adds a listener to this Resource.
|
protected void |
fireUpdateEvent(long timestamp)
Called by the WatchDog if a change in the underlying
Resource is detected.
|
String |
getContent()
Returns the content of this Resource
|
long |
getLastChangeTimestamp()
Return the last change timestamp of this Resource in millis
|
String |
getName()
Returns the name of this Resource
|
protected ResourceLoader |
getResourceLoader() |
protected boolean |
isOlderAs(long resourceChangeTimestamp)
Returns true if this Resource's change timestamp is older as the given
timestamp
|
void |
removeListener(ResourceListener listener)
Removes the listener from this Resource
|
String |
toString() |
public Resource(String aName)
aName - name of the Resourcepublic Resource(String aName, boolean aWatch)
aName - name of the ResourceaWatch - must be this Resource up to date with its physical changespublic Resource(String aName, ResourceLoader aResourceLoader, boolean watch)
aName - name of the ResourceaWatch - must be this Resource up to date with its physical changesaResourceLoader - ResourceLoader that is used to load its underlyingpublic void addListener(ResourceListener listener)
listener - a listener to addpublic void removeListener(ResourceListener listener)
listener - public long getLastChangeTimestamp()
public String getName()
public String getContent()
protected boolean isOlderAs(long resourceChangeTimestamp)
resourceChangeTimestamp - protected void fireUpdateEvent(long timestamp)
timestamp - protected ResourceLoader getResourceLoader()
Copyright © 2010-2014 anotheria.net. All Rights Reserved.