com.ds.fw.utils
Class FwObjectFiler

java.lang.Object
  |
  +--com.ds.fw.utils.FwObjectFiler

public class FwObjectFiler
extends java.lang.Object

I can be used to store an object graph to a flat file and read it back. Example: FwObjectFiler.save("temp.ser", new Vector()); ... Vector v = (Vector) FwObjectFiler.load("temp.ser");


Constructor Summary
FwObjectFiler()
           
 
Method Summary
static boolean fileExists(java.lang.String filename)
          Check if a file with a given as parameter filename exists
static java.lang.Object load(java.lang.String filename)
          Load a file
static void save(java.lang.String filename, java.lang.Object object)
          Used to save an object in a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FwObjectFiler

public FwObjectFiler()
Method Detail

save

public static void save(java.lang.String filename,
                        java.lang.Object object)
Used to save an object in a file

Parameters:
filename - - the name of the file in which the object is going to be saved
object - - the object to be saved

load

public static java.lang.Object load(java.lang.String filename)
Load a file

Parameters:
filename - - the file to be loaded
Returns:
an object,containing the contents of the file

fileExists

public static boolean fileExists(java.lang.String filename)
Check if a file with a given as parameter filename exists

Parameters:
filename - - the file name
Returns:
true if a file with this name exists