Commit Graph

30 Commits

Author SHA1 Message Date
Michael Bayne 0e853085d5 OK boys, we're going in. Revamped the resource manager now that it doesn't
handle downloading of resources, it simply manages them in situ. Getdown
is now responsible for all the downloading.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3060 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-07-14 14:06:46 +00:00
Michael Bayne c7223a89e1 New commons world order.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3059 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-07-13 16:37:40 +00:00
Michael Bayne 9160490ffb Made wipeBundle() accessible to external callers, moved a protected method
into its happy place.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3042 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-07-03 03:21:05 +00:00
Michael Bayne 425e8a6dcb If we fail to resolve our jar file, it is most likely corrupt, so delete
it and allow the resource manager to redownload.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3036 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-06-19 08:09:33 +00:00
Michael Bayne 6cd4e73720 Import cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2970 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-25 14:49:56 +00:00
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 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 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 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 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 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
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 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 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 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 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
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 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
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 e1f4b19e37 Commented out debug logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2138 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-14 02:51:40 +00:00
Michael Bayne 88cc8303fa Update cached resource files when appropriate.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2134 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-14 00:58:59 +00:00
Michael Bayne e400ba5be6 Resources are unpacked and cached in a temporary directory on the
filesystem. This should speed up subsequent loads as they won't have to be
decompressed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2117 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-13 22:50:36 +00:00
Michael Bayne a08d08850e Provide access to the source file from which a resource bundle was
created.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1652 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-08-19 23:31:48 +00:00
Walter Korman 9f641c5796 Download resource bundles asynchronously and provide facilities for
observing bundle downloading progress.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1595 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-19 20:12:23 +00:00
Michael Bayne a040ab4832 Added containsResource() and a sensible toString().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@627 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-20 03:46:28 +00:00
Michael Bayne 21ed644984 Added support for loading resources from named resource bundles which are
configured relative to an application root which must be provided to the
resource manager at construct time or via the application.root system
property.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@625 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-20 00:21:41 +00:00