Search in sources :

Example 26 with XMLEncoder

use of java.beans.XMLEncoder in project wcomponents by BorderTech.

the class MenuPanel method storeRecentList.

/**
 * Writes the list of recent selections to a file on the file system.
 */
private void storeRecentList() {
    synchronized (recent) {
        try {
            OutputStream out = new BufferedOutputStream(new FileOutputStream(RECENT_FILE_NAME));
            XMLEncoder encoder = new XMLEncoder(out);
            encoder.writeObject(recent);
            encoder.close();
        } catch (IOException ex) {
            LogFactory.getLog(getClass()).error("Unable to save recent list", ex);
        }
    }
}
Also used : XMLEncoder(java.beans.XMLEncoder) BufferedOutputStream(java.io.BufferedOutputStream) OutputStream(java.io.OutputStream) FileOutputStream(java.io.FileOutputStream) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) BufferedOutputStream(java.io.BufferedOutputStream)

Aggregations

XMLEncoder (java.beans.XMLEncoder)26 ByteArrayOutputStream (java.io.ByteArrayOutputStream)11 XMLDecoder (java.beans.XMLDecoder)8 BufferedOutputStream (java.io.BufferedOutputStream)6 ByteArrayInputStream (java.io.ByteArrayInputStream)6 FileOutputStream (java.io.FileOutputStream)6 IOException (java.io.IOException)6 LinkedList (java.util.LinkedList)5 Test (org.junit.Test)5 ExceptionListener (java.beans.ExceptionListener)4 PersistenceDelegate (java.beans.PersistenceDelegate)4 File (java.io.File)4 FileInputStream (java.io.FileInputStream)4 AssertionFailedError (junit.framework.AssertionFailedError)4 DefaultPersistenceDelegate (java.beans.DefaultPersistenceDelegate)3 Encoder (java.beans.Encoder)3 Expression (java.beans.Expression)2 BufferedInputStream (java.io.BufferedInputStream)2 FileNotFoundException (java.io.FileNotFoundException)2 OutputStream (java.io.OutputStream)2