From ad4ac9318ace84a88fe821c2a7ed602416ed99e1 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Mon, 18 Oct 2004 21:38:22 +0000 Subject: [PATCH] Modified wipeBundle() to allow preservation of the jar file and to wipe out Getdown's "verified" marker file so that Getdown will recompute the jar file's MD5 hash and then wipe it out and redownload it only if it is actually corrupted. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3146 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/resource/ResourceBundle.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/java/com/threerings/resource/ResourceBundle.java b/src/java/com/threerings/resource/ResourceBundle.java index 85db30678..4d55c93b7 100644 --- a/src/java/com/threerings/resource/ResourceBundle.java +++ b/src/java/com/threerings/resource/ResourceBundle.java @@ -1,5 +1,5 @@ // -// $Id: ResourceBundle.java,v 1.31 2004/08/27 02:20:34 mdb Exp $ +// $Id: ResourceBundle.java,v 1.32 2004/10/18 21:38:22 mdb Exp $ // // Narya library - tools for developing networked games // Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved @@ -115,7 +115,7 @@ public class ResourceBundle } catch (IOException ioe) { Log.warning("Failure resolving jar file '" + _source + "': " + ioe + "."); - wipeBundle(); + wipeBundle(true); return false; } @@ -176,7 +176,7 @@ public class ResourceBundle // if something went awry, delete everything in the hopes // that next time things will work if (failure) { - wipeBundle(); + wipeBundle(true); return false; } } @@ -206,7 +206,7 @@ public class ResourceBundle * hopes that we can download it afresh and everything will work the * next time around. */ - public void wipeBundle () + public void wipeBundle (boolean deleteJar) { // clear out our cache directory if (_cache != null) { @@ -218,16 +218,16 @@ public class ResourceBundle _unpacked.delete(); } + // clear out any .jarv file that Getdown might be maintaining so + // that we ensure that it is revalidated + File vfile = new File(FileUtil.resuffix(_source, ".jar", ".jarv")); + vfile.delete(); + // close and delete our source jar file - if (_source != null) { + if (deleteJar && _source != null) { closeJar(); _source.delete(); } - - // also clear out any .vers file that the downloader might be - // maintaining if this is a versioned resource bundle - File vfile = new File(FileUtil.resuffix(_source, ".jar", ".vers")); - vfile.delete(); } /**