com.threerings.cast.bundle
Class BundleUtil

java.lang.Object
  extended by com.threerings.cast.bundle.BundleUtil

public class BundleUtil
extends Object

Utility functions related to creating and manipulating component bundles.


Field Summary
static String ACTION_SETS_PATH
          The path in the metadata bundle to the serialized action tile sets table.
static String ACTIONS_PATH
          The path in the metadata bundle to the serialized action table.
static String CLASSES_PATH
          The path in the metadata bundle to the serialized component class table.
static String COMPONENTS_PATH
          The path in the component bundle to the serialized component id to class/type mapping.
static String IMAGE_EXTENSION
          The file extension of our action tile images.
static String TILESET_EXTENSION
          The serialized tileset extension for our action tilesets.
 
Constructor Summary
BundleUtil()
           
 
Method Summary
static Object loadObject(ResourceBundle bundle, String path, boolean wipeOnFailure)
          Attempts to load an object from the supplied resource bundle with the specified path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTIONS_PATH

public static final String ACTIONS_PATH
The path in the metadata bundle to the serialized action table.

See Also:
Constant Field Values

ACTION_SETS_PATH

public static final String ACTION_SETS_PATH
The path in the metadata bundle to the serialized action tile sets table.

See Also:
Constant Field Values

CLASSES_PATH

public static final String CLASSES_PATH
The path in the metadata bundle to the serialized component class table.

See Also:
Constant Field Values

COMPONENTS_PATH

public static final String COMPONENTS_PATH
The path in the component bundle to the serialized component id to class/type mapping.

See Also:
Constant Field Values

IMAGE_EXTENSION

public static final String IMAGE_EXTENSION
The file extension of our action tile images.

See Also:
Constant Field Values

TILESET_EXTENSION

public static final String TILESET_EXTENSION
The serialized tileset extension for our action tilesets.

See Also:
Constant Field Values
Constructor Detail

BundleUtil

public BundleUtil()
Method Detail

loadObject

public static Object loadObject(ResourceBundle bundle,
                                String path,
                                boolean wipeOnFailure)
                         throws IOException,
                                ClassNotFoundException
Attempts to load an object from the supplied resource bundle with the specified path.

Parameters:
wipeOnFailure - if there is an error reading the object from the bundle and this parameter is true, we will instruct the bundle to delete its underlying jar file before propagating the exception with the expectation that it will be redownloaded and repaired the next time the application is run.
Returns:
the unserialized object in question.
Throws:
IOException - thrown if an I/O error occurs while reading the object from the bundle.
ClassNotFoundException