Go back to having BundleUtil return null rather than throwing FNF.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2132 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-01-14 00:36:14 +00:00
parent 5a51f58bdd
commit 4e796ad5b1
2 changed files with 8 additions and 13 deletions
@@ -1,5 +1,5 @@
// //
// $Id: BundleUtil.java,v 1.4 2003/01/13 22:53:04 mdb Exp $ // $Id: BundleUtil.java,v 1.5 2003/01/14 00:36:14 mdb Exp $
package com.threerings.cast.bundle; package com.threerings.cast.bundle;
@@ -45,8 +45,6 @@ public class BundleUtil
* *
* @return the unserialized object in question. * @return the unserialized object in question.
* *
* @exception FileNotFoundException thrown if no object exists with
* the specified path.
* @exception IOException thrown if an I/O error occurs while reading * @exception IOException thrown if an I/O error occurs while reading
* the object from the bundle. * the object from the bundle.
*/ */
@@ -56,7 +54,7 @@ public class BundleUtil
try { try {
InputStream bin = bundle.getResource(path); InputStream bin = bundle.getResource(path);
if (bin == null) { if (bin == null) {
throw new FileNotFoundException(path); return null;
} }
return new ObjectInputStream(bin).readObject(); return new ObjectInputStream(bin).readObject();
@@ -1,5 +1,5 @@
// //
// $Id: BundledComponentRepository.java,v 1.23 2003/01/13 22:53:04 mdb Exp $ // $Id: BundledComponentRepository.java,v 1.24 2003/01/14 00:36:14 mdb Exp $
package com.threerings.cast.bundle; package com.threerings.cast.bundle;
@@ -110,10 +110,9 @@ public class BundledComponentRepository
// now go back and load up all of the component information // now go back and load up all of the component information
for (int i = 0; i < rbundles.length; i++) { for (int i = 0; i < rbundles.length; i++) {
HashIntMap comps = null; HashIntMap comps = null;
try { comps = (HashIntMap)BundleUtil.loadObject(
comps = (HashIntMap)BundleUtil.loadObject( rbundles[i], BundleUtil.COMPONENTS_PATH);
rbundles[i], BundleUtil.COMPONENTS_PATH); if (comps == null) {
} catch (FileNotFoundException fnfe) {
continue; continue;
} }
@@ -294,10 +293,8 @@ public class BundledComponentRepository
String path = root + action + BundleUtil.TILESET_EXTENSION; String path = root + action + BundleUtil.TILESET_EXTENSION;
try { try {
TileSet aset = null; TileSet aset = (TileSet)BundleUtil.loadObject(_bundle, path);
try { if (aset == null) {
aset = (TileSet)BundleUtil.loadObject(_bundle, path);
} catch (FileNotFoundException fnfe) {
Log.debug("Falling back to default [path=" + path + "]."); Log.debug("Falling back to default [path=" + path + "].");
// try loading the default tileset // try loading the default tileset
path = root + ActionSequence.DEFAULT_SEQUENCE + path = root + ActionSequence.DEFAULT_SEQUENCE +