diff --git a/src/java/com/threerings/media/tile/bundle/tools/TileSetBundler.java b/src/java/com/threerings/media/tile/bundle/tools/TileSetBundler.java index 487f9d882..19667b484 100644 --- a/src/java/com/threerings/media/tile/bundle/tools/TileSetBundler.java +++ b/src/java/com/threerings/media/tile/bundle/tools/TileSetBundler.java @@ -1,5 +1,5 @@ // -// $Id: TileSetBundler.java,v 1.1 2001/11/21 02:42:15 mdb Exp $ +// $Id: TileSetBundler.java,v 1.2 2001/11/29 00:13:20 mdb Exp $ package com.threerings.media.tools.tile.bundle; @@ -96,6 +96,16 @@ public class TileSetBundler */ public TileSetBundler (String configPath) throws IOException + { + this(new File(configPath)); + } + + /** + * Constructs a tileset bundler with the specified bundler config + * file. + */ + public TileSetBundler (File configFile) + throws IOException { // we parse our configuration with a digester Digester digester = new Digester(); @@ -117,7 +127,7 @@ public class TileSetBundler digester.addCallParam("bundler-config/mapping/ruleset", 1); // now go like the wind - FileInputStream fin = new FileInputStream(configPath); + FileInputStream fin = new FileInputStream(configFile); try { digester.parse(fin); } catch (SAXException saxe) { @@ -172,6 +182,27 @@ public class TileSetBundler public void createBundle ( TileSetIDBroker idBroker, File bundleDesc, String targetPath) throws IOException + { + createBundle(idBroker, bundleDesc, new File(targetPath)); + } + + /** + * Creates a tileset bundle at the location specified by the + * targetPath parameter, based on the description + * provided via the bundleDesc parameter. + * + * @param idBroker the tileset id broker that will be used to map + * tileset names to tileset ids. + * @param bundleDef a file object pointing to the bundle description + * file. + * @param target the tileset bundle file that will be created. + * + * @exception IOException thrown if an error occurs reading, writing + * or processing anything. + */ + public void createBundle ( + TileSetIDBroker idBroker, File bundleDesc, File target) + throws IOException { // stick an array list on the top of the stack into which we will // collect parsed tilesets @@ -232,7 +263,6 @@ public class TileSetBundler } // now we have to create the actual bundle file - File target = new File(targetPath); FileOutputStream fout = new FileOutputStream(target); Manifest manifest = new Manifest(); JarOutputStream jar = new JarOutputStream(fout, manifest);