diff options
author | Andrew Su <[email protected]> | 2011-05-30 13:50:35 -0400 |
---|---|---|
committer | Andrew Su <[email protected]> | 2011-05-30 13:50:35 -0400 |
commit | fbbeace7bbc50dc6b7fe348f9bf50bcb4479f55a (patch) | |
tree | f1ad3b6be5264f016806165167b7bdfba0f07731 /netx/net/sourceforge/jnlp/cache/ResourceTracker.java | |
parent | 12643dc1a1c0bb43e240df651c2ea6ca9853a432 (diff) |
Fix cache to allow redownload on next run when javaws is killed
Diffstat (limited to 'netx/net/sourceforge/jnlp/cache/ResourceTracker.java')
-rw-r--r-- | netx/net/sourceforge/jnlp/cache/ResourceTracker.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java index 6bf2ae7..058ae99 100644 --- a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java +++ b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java @@ -675,7 +675,7 @@ public class ResourceTracker { CacheEntry downloadEntry = new CacheEntry(downloadLocation, resource.downloadVersion); File finalFile = CacheUtil.getCacheFile(resource.location, resource.downloadVersion); // This is where extracted version will be, or downloaded file if not compressed. - if (!finalFile.exists()) { + if (!downloadEntry.isCurrent(con)) { // Make sure we don't re-download the file. however it will wait as if it was downloading. // (This is fine because file is not ready yet anyways) byte buf[] = new byte[1024]; @@ -700,6 +700,7 @@ public class ResourceTracker { * If the file was compressed, uncompress it. */ if (packgz) { + downloadEntry.initialize(con); GZIPInputStream gzInputStream = new GZIPInputStream(new FileInputStream(CacheUtil .getCacheFile(downloadLocation, resource.downloadVersion))); InputStream inputStream = new BufferedInputStream(gzInputStream); @@ -714,6 +715,7 @@ public class ResourceTracker { inputStream.close(); gzInputStream.close(); } else if (gzip) { + downloadEntry.initialize(con); GZIPInputStream gzInputStream = new GZIPInputStream(new FileInputStream(CacheUtil .getCacheFile(downloadLocation, resource.downloadVersion))); InputStream inputStream = new BufferedInputStream(gzInputStream); |