org.oddjob.persist
Class SerializeWithFile

java.lang.Object
  extended by org.oddjob.persist.SerializeWithFile

public class SerializeWithFile
extends Object

Serialize an object to and from file with the given name. The .ser extension is added to the file name.

When writing a temporary name is used in case the process is kill mid writing so there is less chance of a corrupted file. The temporary name includes an underscore in the name.

Author:
Rob Gordon.

Constructor Summary
SerializeWithFile()
           
 
Method Summary
 String[] children(File dir)
           
 void clear(File dir)
           
 Object fromFile(File dir, String name, ClassLoader classLoader)
           
 String[] list(File dir)
           
 void remove(File dir, String name)
           
 void toFile(File dir, String name, Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializeWithFile

public SerializeWithFile()
Method Detail

toFile

public void toFile(File dir,
                   String name,
                   Object o)
            throws ComponentPersistException
Throws:
ComponentPersistException

remove

public void remove(File dir,
                   String name)

fromFile

public Object fromFile(File dir,
                       String name,
                       ClassLoader classLoader)
                throws ComponentPersistException
Throws:
ComponentPersistException

clear

public void clear(File dir)

list

public String[] list(File dir)

children

public String[] children(File dir)