Package org.garret.perst

Examples of org.garret.perst.Storage.open()


    this.xstreamFile = xstreamFile;
  }

  public void toXML() {
    Storage db = StorageFactory.getInstance().createStorage();
    db.open(databaseFile);
    new XStreamFile(xstreamFile).write((Set) db.getRoot());
    db.close();
  }

  public void fromXML() {
View Full Code Here


    db.close();
  }

  public void fromXML() {
    Storage db = StorageFactory.getInstance().createStorage();
    db.open(databaseFile);
    db.setRoot(db.createSet());
    for (Object obj : new XStreamFile(xstreamFile).read()) {
      ((Set) db.getRoot()).add(obj);
      db.store(obj);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.