aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp/cache/CacheEntry.java
diff options
context:
space:
mode:
authorAndrew Su <[email protected]>2011-04-18 17:38:31 -0400
committerAndrew Su <[email protected]>2011-04-18 17:38:31 -0400
commitd2ab6fbc6ac11d8d4684f2f855a5324548227917 (patch)
tree56a36a6682480f03a927791db26b63f6a310e9c8 /netx/net/sourceforge/jnlp/cache/CacheEntry.java
parent3614db44151bb47e747226e5bd49d30bb9620e96 (diff)
Changed cache to prevent jar overwriting when update happens.
Diffstat (limited to 'netx/net/sourceforge/jnlp/cache/CacheEntry.java')
-rw-r--r--netx/net/sourceforge/jnlp/cache/CacheEntry.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/netx/net/sourceforge/jnlp/cache/CacheEntry.java b/netx/net/sourceforge/jnlp/cache/CacheEntry.java
index affb5fb..8d70da6 100644
--- a/netx/net/sourceforge/jnlp/cache/CacheEntry.java
+++ b/netx/net/sourceforge/jnlp/cache/CacheEntry.java
@@ -162,4 +162,24 @@ public class CacheEntry {
properties.store();
}
+ /**
+ * Mark this entry for deletion at shutdown.
+ */
+ public void markForDelete() { // once marked it should not be unmarked.
+ properties.setProperty("delete", Boolean.toString(true));
+ }
+
+ /**
+ * Lock cache item.
+ */
+ protected void lock() {
+ CacheUtil.lockFile(properties);
+ }
+
+ /**
+ * Unlock cache item.
+ */
+ protected void unlock() {
+ CacheUtil.unlockFile(properties);
+ }
}