Commit Graph

76 Commits

Author SHA1 Message Date
Michael Bayne 9672534004 Make sure the cache and .stamp paths are not versioned. Also ensure we
don't leave any unversioned bundles lying around after a conversion.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2847 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-10-29 23:09:48 +00:00
Michael Bayne 41ce70349b Revamped the way we handle versioned jar files such that each bundle is
named according to its version number so that when we patch an old version
to create a new version, we don't have to do any renaming, we just create
the new version directly and hopefully avoid this bullshit problem on
Windows where we're unable to rename a goddamned file.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2846 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-10-29 22:31:55 +00:00
Michael Bayne 7a9f2557f0 Try another strategy if we fail to remain our original file.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2845 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-10-29 02:42:56 +00:00
Michael Bayne ba26e551bd Differentiate between dynamic resource URLs.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2842 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-10-27 11:43:26 +00:00
Ray Greenwell eca5077375 Do the post-download portion of a bundle immediately after each bundle
instead of waiting for them all to complete.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2830 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-10-23 20:31:28 +00:00
Michael Bayne 3fadb2b1ea Fucking JarFile throws a SecurityException if there's a signing error
which is *not* an IOException. Thanks guys.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2827 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-10-22 18:50:27 +00:00
Michael Bayne 73373b8844 Propagate up an exception if we're not able to download the resource
manager config (usually a transient DNS failure).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2812 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-09-24 23:54:59 +00:00
Michael Bayne 6b5542d915 Only read in the current version if we've got both the version file and
the bundle file.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2785 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-20 03:53:35 +00:00
Michael Bayne 026be0505a Check for file existence.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2784 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-20 03:52:36 +00:00
Michael Bayne 693ce550d7 We need to update our last modified time after downloading the resource.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2780 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-18 21:50:03 +00:00
Michael Bayne c78accd506 Minor edit.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2775 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-15 23:58:02 +00:00
Michael Bayne c0ea432776 Changed dynamic resource URL handling such that it must be set
programmatically or it will be assumed to be the same as the normal
resource URL.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2774 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-15 23:23:05 +00:00
Michael Bayne 8ab26de8b0 Now that we're closing the jarfile after unpacking it, we can't be poking
around in there for other reasons. We also avoid looking up the entry in
the jar file every time it is requested.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2766 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-11 20:34:21 +00:00
Michael Bayne cb89eaf73d Reorganized so that we notice bundle unpack failure and report the failure
to our bundle download observer.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2765 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-09 05:51:12 +00:00
Michael Bayne 36f738949d Made sourceIsReady() more robust and it now returns whether or not it
successfully unpacked its jar file so that we can report bundle download
borkage and retry in the face of potentially transient fuckolas.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2764 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-09 05:42:13 +00:00
Michael Bayne 927881306d Use FileUtil.resuffix().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2763 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-09 05:27:07 +00:00
Michael Bayne 1d3e8247e8 Throw a particular exception when we fail to patch bundles.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2757 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-09 00:31:27 +00:00
Michael Bayne b9341c9430 Break out and report the patching and unpacking phases.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2756 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-09 00:31:14 +00:00
Michael Bayne bd893f198e Try using .old rather than .jar.old and maybe that will fix the weird
problem with not being able to rename some, but not all, of the old jar
files prior to patching them.

Also, took out the assume v0.22 hack as we should be good to go on that
front by the next release, the stragglers will just have to download a
full update (which is safer anyway).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2754 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-08 23:45:39 +00:00
Michael Bayne 3034364579 Use a downloader that checks timestamps if we're not doing versioning.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2747 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-08 17:45:00 +00:00
Michael Bayne 5f38a9e44e We have to close the borked patch file before attempting to delete it.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2746 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-08 03:40:46 +00:00
Michael Bayne 8ceaea36ed Only report that we're downloading if we actually are.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2742 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-05 23:34:01 +00:00
Michael Bayne 00b983ccf7 Break the patching out into a separate phase, clean up the diff and old
jar files when we're done patching.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2741 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-05 07:03:34 +00:00
Michael Bayne d773b9d723 Properly handle errors and do the right thing if we have no version
specified (which should fix versionless dynamic downloads).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2740 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-05 06:54:01 +00:00
Michael Bayne 636b792051 The great big resource manager revamp: the resource manager now supports
the JNLP versioned resource protocol so that it can download jardiffs
instead of whole new jar files when a resource bundle is updated.
Unversioned http downloads (which we'll probably continue to use for the
dynamically generated island bundles) are currently not working.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2739 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-05 01:33:20 +00:00
Ray Greenwell 96998e5678 Set _sourceLastMod to -1 when uninitialized instead of 0, so that we can
distinguish between uninitialized and various file errors, and hopefully
get us some better logging output. (If there are errors with a file,
lastModified() returns 0, which would have caused resolveJarFile to think
that the bundle just wasn't ready yet and not create the JarFile object,
which resulted in a NPE, and not useful IOEs.)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2709 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-07-14 22:18:18 +00:00
Ray Greenwell e140fd6301 Use the AttachableURLFactory.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2696 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-07-09 18:44:52 +00:00
Ray Greenwell 3d8e053a7f Added the ability to add dynamic bundles which can be downloaded and added
in while the game is running.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2668 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-06-19 01:30:27 +00:00
Ray Greenwell b4f2c4c526 Added isUnpacked(), which lets us know if the bundle is downloaded and
ready to go.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2667 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-06-19 01:12:59 +00:00
Michael Bayne 629a61d6b5 Report the error directly when we fail to create a jar file.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2664 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-06-18 16:54:17 +00:00
Michael Bayne d35e7b8180 Change the default resource directory to .narya so that we can leave the
code in that blows away .naryarsrc without having it constantly conflict
with the tools that we run.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2626 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-29 16:35:59 +00:00
Michael Bayne 79715e61a4 Screw unpacking our bundles on the fly. Just unpack them once when they
are downloaded and leave them be until the bundle is updated.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2612 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-27 07:52:45 +00:00
Michael Bayne 2d958634c0 Provide a post-download hook that is run on the download manager thread.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2611 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-27 07:51:49 +00:00
Michael Bayne 8c8cd1a2ea Allow the temporary cache directory to be explicitly specified.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2591 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-20 16:29:36 +00:00
Michael Bayne 37011fed41 Use user.home rather than user.dir as a fallback.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2574 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-14 20:46:25 +00:00
Michael Bayne f1bcf698db Rather than allow an Error to be thrown, we just log a warning and go on
about our business.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2549 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-07 05:31:09 +00:00
Ray Greenwell 61ce868a11 Register the "resource" url handler with a factory instead of using
the system property. The factory works under JWS, but is a little
worrisome because you can only have one factory per JVM.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2547 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-06 18:48:18 +00:00
Michael Bayne 456dc57129 Moved the creation of the shutdown hook into the same static block that
creates the temp cache directory so that it is only registered once even
if multiple resource managers are created by the JVM (which happens in ant
builds).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2544 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-05 18:02:37 +00:00
Ray Greenwell 7f8ef8f01e Use FileUtil's deleteRecursive()
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2540 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-03 00:51:13 +00:00
Ray Greenwell c3737ca73f Register a shutdown hook to destroy the resource cache directory when
the JVM exits.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2539 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-03 00:45:36 +00:00
Michael Bayne 8ce7d7bc69 Slap a big fat random number on the end of our cache directory to avoid
annoyances when we run multiple clients for testing.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2488 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-28 18:21:47 +00:00
Michael Bayne 3962a0fa77 Allow our resource cache directory to be configured.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2472 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-27 03:27:33 +00:00
Michael Bayne e1ba8eeeec Allow others to know what our cache directory is.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2471 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-27 03:27:21 +00:00
Ray Greenwell 26d15d3d23 Corrected documentation: the resource set is supplied, not the specific
bundle.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2450 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-24 07:26:45 +00:00
Ray Greenwell 5d6e746b88 Wire up the magic so that data in resource bundles can be acquired via
URLs.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2449 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-24 07:23:47 +00:00
Michael Bayne 24b6d1fcec Activate our bundles before turning our download observers loose.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2277 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-02-12 18:11:33 +00:00
Michael Bayne 162f0836d9 Don't delay access to our resources unless we're specifically told that we
should wait.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2246 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-02-06 19:13:49 +00:00
Walter Korman 87209ce461 Deal gracefully with having a null jar source in toString() even after an
attempt to resolve the jar file.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2243 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-02-05 22:48:50 +00:00
Michael Bayne 5414507e3a Don't allow the resource bundles to attempt to access their resource jar
files until they are known to be safely updated and ready to go.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2185 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-18 19:56:45 +00:00
Michael Bayne 0ad5e615b7 Provide means by which resource resolution and download observers can be
notified on the AWT thread rather than the download thread.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2167 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-16 22:50:29 +00:00