appl.util
Class GeneralUtil

java.lang.Object
  extended by appl.util.GeneralUtil

public class GeneralUtil
extends Object

General utility class. See method description for details.

Author:
Dominik Appl

Field Summary
static Logger LOG
           
 
Constructor Summary
GeneralUtil()
           
 
Method Summary
static Object loadClassFromURL(URL location, String classname)
          Loads a class from the specified URL and returns an instance of this class.
static Object readSerializedFrom(File loadFile)
          Reads the first object out of the file
static void SerializeToFile(Object o, File destFile)
          Serializes the given object into the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static Logger LOG
Constructor Detail

GeneralUtil

public GeneralUtil()
Method Detail

loadClassFromURL

public static Object loadClassFromURL(URL location,
                                      String classname)
Loads a class from the specified URL and returns an instance of this class.

Parameters:
location - the URL of the rootDirectory/networkLocation
classname - the fully qualified name of the class (the class must have a
Returns:
the instance of the class or null if loading fails

SerializeToFile

public static void SerializeToFile(Object o,
                                   File destFile)
Serializes the given object into the specified file. All exceptions are printed to console.

Parameters:
o - the object
destFile - the file to write to

readSerializedFrom

public static Object readSerializedFrom(File loadFile)
Reads the first object out of the file

Parameters:
loadFile - the file to read from
Returns:
the object