| java.lang.Object org.apache.tapestry.internal.util.URLChangeTracker
URLChangeTracker | public class URLChangeTracker (Code) | | Given a (growing) set of URLs, can periodically check to see if any of the underlying resources
has changed. This class is capable of using either millisecond-level granularity or second-level
granularity. Millisecond-level granularity is used by default. Second-level granularity is
provided for compatibility with browsers vis-a-vis resource caching -- that's how granular they
get with their "If-Modified-Since", "Last-Modified" and "Expires" headers.
|
Constructor Summary | |
public | URLChangeTracker() Creates a new URL change tracker with millisecond-level granularity. | public | URLChangeTracker(boolean granularitySeconds) Creates a new URL change tracker, using either millisecond-level granularity or second-level
granularity. |
Method Summary | |
public long | add(URL url) Stores a new URL into the tracker, or returns the previous time stamp for a previously added
URL. | public void | clear() Clears all URL and timestamp data stored in the tracker. | public boolean | containsChanges() Re-acquires the last updated timestamp for each URL and returns true if any timestamp has
changed. | public void | forceChange() Needed for testing; changes file timestamps so that a change will be detected by
URLChangeTracker.containsChanges() . | int | trackedFileCount() Needed for testing. |
URLChangeTracker | public URLChangeTracker()(Code) | | Creates a new URL change tracker with millisecond-level granularity.
|
URLChangeTracker | public URLChangeTracker(boolean granularitySeconds)(Code) | | Creates a new URL change tracker, using either millisecond-level granularity or second-level
granularity.
Parameters: granularitySeconds - whether or not to use second-level granularity |
add | public long add(URL url)(Code) | | Stores a new URL into the tracker, or returns the previous time stamp for a previously added
URL. Filters out all non-file URLs.
Parameters: url - of the resource to add the current timestamp for the URL, or 0 if not a file URL |
clear | public void clear()(Code) | | Clears all URL and timestamp data stored in the tracker.
|
containsChanges | public boolean containsChanges()(Code) | | Re-acquires the last updated timestamp for each URL and returns true if any timestamp has
changed.
|
trackedFileCount | int trackedFileCount()(Code) | | Needed for testing.
|
|
|