Package com.thoughtworks.xstream.persistence

Examples of com.thoughtworks.xstream.persistence.PersistenceStrategy


          new File(ruta).mkdirs();
            //System.out.println("created:"+ruta);
        }

      //System.out.println("RUTA:"+ruta+"/"+serName);
      PersistenceStrategy strategy = new FilePersistenceStrategy(new File(ruta));
      // creates the list:
      List list = new XmlArrayList(strategy);
      list.add(event);
      return true;
    }
View Full Code Here


      return false;
    }
   }
  
   public Event getEventByID(String id,String path,String serName){
       PersistenceStrategy strategy = new FilePersistenceStrategy(new File(path+"/"+serName));
    // creates the list:
    List list = new XmlArrayList(strategy);
    for(Iterator it = list.iterator(); it.hasNext(); ) {
      Event event = (Event) it.next();
      if(event.getId().equals(id)) {
View Full Code Here

      OnlyDir onlyDir = new OnlyDir();
      String[] listDirs = file.list(onlyDir);
      Vector vector =new Vector();
      for(int i = 0;i<listDirs.length;i++){
        try{
          PersistenceStrategy strategy = new FilePersistenceStrategy(new File(path+"/"+serName+"/"+listDirs[i]));
          List list = new XmlArrayList(strategy);
       
          for(Iterator it = list.iterator(); it.hasNext(); ) {
           
            Event event = (Event) it.next();
View Full Code Here

    }
   
   }
     
   public Event[] getAllEvents(String path,String serName){
       PersistenceStrategy strategy = new FilePersistenceStrategy(new File(path+"/"+serName));
    // creates the list:
    List list = new XmlArrayList(strategy);
    if(list.size()>0){
      Event[] array = (Event[])list.toArray(new Event[list.size()]);
      return array;
View Full Code Here

    else
      return null;
   }
  
   public boolean delEvent(String id,String path,String serName){
       PersistenceStrategy strategy = new FilePersistenceStrategy(new File(path+"/"+serName));
    // creates the list:
    List list = new XmlArrayList(strategy);
    for(Iterator it = list.iterator(); it.hasNext(); ) {
      Event event = (Event) it.next();
      if(event.getId().equals(id)) {
View Full Code Here

    }
    return false;
   }
  
   public boolean updEvent(String id,Event newEvent,String path,String serName){
       PersistenceStrategy strategy = new FilePersistenceStrategy(new File(path+"/"+serName));
    // creates the list:
    List list = new XmlArrayList(strategy);
    for(Iterator it = list.iterator(); it.hasNext(); ) {
      Event event = (Event) it.next();
      if(event.getId().equals(id)) {
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.persistence.PersistenceStrategy

Copyright © 2018 www.massapicom. 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.