/hg/release/icedtea-web-1.1: Fix cache to allow redownload on ne...

asu at icedtea.classpath.org asu at icedtea.classpath.org
Mon May 30 10:49:35 PDT 2011


changeset 60b21220df55 in /hg/release/icedtea-web-1.1
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.1?cmd=changeset;node=60b21220df55
author: Andrew Su <asu at redhat.com>
date: Mon May 30 13:50:35 2011 -0400

	Fix cache to allow redownload on next run when javaws is killed


diffstat:

 ChangeLog                                            |  5 +++++
 netx/net/sourceforge/jnlp/cache/ResourceTracker.java |  4 +++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diffs (40 lines):

diff -r de182e65a6e1 -r 60b21220df55 ChangeLog
--- a/ChangeLog	Mon May 30 13:15:50 2011 -0400
+++ b/ChangeLog	Mon May 30 13:50:35 2011 -0400
@@ -1,3 +1,8 @@
+2011-05-30  Andrew Su  <asu at redhat.com>
+
+	* netx/net/sourceforge/jnlp/cache/ResourceTracker.java:
+	(downloadResource): Check whether file to be downloaded is current.
+
 2011-05-30  Andrew Su  <asu at redhat.com>
 
 	* netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java:
diff -r de182e65a6e1 -r 60b21220df55 netx/net/sourceforge/jnlp/cache/ResourceTracker.java
--- a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java	Mon May 30 13:15:50 2011 -0400
+++ b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java	Mon May 30 13:50:35 2011 -0400
@@ -675,7 +675,7 @@
             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 @@
                  * 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 @@
                     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);



More information about the distro-pkg-dev mailing list