Package net.sourceforge.jnlp.cache
Class UpdatePolicy
- java.lang.Object
-
- net.sourceforge.jnlp.cache.UpdatePolicy
-
public class UpdatePolicy extends java.lang.Object
A policy that determines when a resource should be checked for an updated version.
-
-
Field Summary
Fields Modifier and Type Field Description static UpdatePolicy
ALWAYS
static UpdatePolicy
FORCE
static UpdatePolicy
NEVER
static UpdatePolicy
SESSION
-
Constructor Summary
Constructors Constructor Description UpdatePolicy()
Create a new update policy; this policy always updates the entry unless the shouldUpdate method is overridden.UpdatePolicy(long timeDiff)
Create an update policy that only checks a file for being updated if it has not been checked for longer than the specified time.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
shouldUpdate(CacheEntry entry)
-
-
-
Field Detail
-
ALWAYS
public static UpdatePolicy ALWAYS
-
SESSION
public static UpdatePolicy SESSION
-
FORCE
public static UpdatePolicy FORCE
-
NEVER
public static UpdatePolicy NEVER
-
-
Constructor Detail
-
UpdatePolicy
public UpdatePolicy()
Create a new update policy; this policy always updates the entry unless the shouldUpdate method is overridden.
-
UpdatePolicy
public UpdatePolicy(long timeDiff)
Create an update policy that only checks a file for being updated if it has not been checked for longer than the specified time.- Parameters:
timeDiff
- how long in ms until update needed
-
-
Method Detail
-
shouldUpdate
public boolean shouldUpdate(CacheEntry entry)
- Parameters:
entry
- entry which shoul;d be cared- Returns:
- whether the resource should be checked for being up-to-date.
-
-