//
// $Id: CompiledConfig.java,v 1.1 2002/03/08 06:15:21 mdb Exp $

package com.threerings.yohoho.util;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

/**
 * Used to load and store compiled configuration data (generally XML files
 * that are parsed into Java object models and then serialized for rapid
 * and simple access on the client and server).
 */
public class CompiledConfig
{
    /**
     * Unserializes a configuration object from the supplied input stream.
     */
    public static Serializable loadConfig (InputStream source)
        throws IOException, ClassNotFoundException
    {
        ObjectInputStream oin = new ObjectInputStream(source);
        return (Serializable)oin.readObject();
    }

    /**
     * Serializes the supplied configuration object to the specified file
     * path.
     */
    public static void saveConfig (File target, Serializable config)
        throws IOException
    {
        FileOutputStream fout = new FileOutputStream(target);
        ObjectOutputStream oout = new ObjectOutputStream(fout);
        oout.writeObject(config);
        oout.close();
    }
}

@@ -28,17 +28,17 @@
 ava,v 1.
-1
+2
  2002/03
@@ -46,15 +46,15 @@
 08 0
-6:15:21
+8:30:05
  mdb
@@ -307,16 +307,63 @@
 zable;%0A%0A
+import com.samskivert.io.NestableIOException;%0A%0A
 /**%0A * U
@@ -772,39 +772,33 @@
 tion
-, ClassNotFoundException%0A    %7B%0A
+%0A    %7B%0A        try %7B%0A    
     
@@ -864,16 +864,20 @@
         
+    
 return (
@@ -903,24 +903,191 @@
 adObject();%0A
+        %7D catch (ClassNotFoundException cnfe) %7B%0A            String errmsg = %22Unknown config class%22;%0A            throw new NestableIOException(errmsg, cnfe);%0A        %7D%0A
     %7D%0A%0A    /

Wrap the ClassNotFoundException in an IOException.