Package net.sf.orexio.lopf.repository

Examples of net.sf.orexio.lopf.repository.TrueZipRepository


   *
   * @return void
   */
  private void initialize() throws IOException,ClassNotFoundException{
    // Initializing lopp
    repository = new TrueZipRepository(new File("AddressBook.zip"));
    repository.open();
    repository.read();
   
    book = new AddressBook<File>(repository);
   
View Full Code Here


      setModified(status);
    }
      return varieties;
    }
    private static Resources open()throws IOException,ClassNotFoundException{
      TrueZipRepository     repository;
      String              folder=CannaGrower.getCannaGrowerFolder().getPath();

    if(!folder.endsWith(System.getProperty("file.separator"))){folder+=System.getProperty("file.separator");}
      repository=new TrueZipRepository(new File(folder+CannaGrower.class.getSimpleName()+"."+Resources.class.getSimpleName()+".jar"));
    repository.open();
    repository.read();
    return new Resources(repository);
  }
View Full Code Here

   *
   * @param type
   */
  public static Culture create(int type)throws IOException,ClassNotFoundException{
    Culture       culture;
    TrueZipRepository  repository;
   
    switch (type) {
    case typeDemo:
      java.util.Date          date=new java.util.Date();
      Plantation             plantation;
      net.sf.cannagrower.data.Event  event;
     
      repository=new TrueZipRepository(new File(Messages.getMessage(Messages.cultureDemoName)+CannaGrower.extension));
      repository.open();
     
      culture=new Culture(repository);

      culture.getHardwares().store(new Room());
      culture.getHardwares().store(new Lamp());
      culture.getHardwares().store(new Intractor());
      culture.getHardwares().store(new Extractor());
      culture.getHardwares().store(new MediumSoil());
     
      plantation=new Plantation(culture);
     
      event=new net.sf.cannagrower.data.event.PlantsAdd();
      event.setDate(date);
      plantation.getEvents().store(event);
     
      date=new java.util.Date(date.getTime()+((1000*60)*60)*24);
      event=new net.sf.cannagrower.data.event.EnvironmentAirState();
      event.setDate(date);
      plantation.getEvents().store(event);     
      event=new net.sf.cannagrower.data.event.EnvironmentMediumState();
      event.setDate(date);
      plantation.getEvents().store(event);
     
      date=new java.util.Date(date.getTime()+((1000*60)*60)*24);
      event=new net.sf.cannagrower.data.event.PlantsCut();
      event.setDate(date);
      plantation.getEvents().store(event);
     
      date=new java.util.Date(date.getTime()+((1000*60)*60)*24);
      event=new net.sf.cannagrower.data.event.EnvironmentLightPeriod();
      event.setDate(date);
      plantation.getEvents().store(event);
     
      date=new java.util.Date(date.getTime()+((1000*60)*60)*24);
      event=new net.sf.cannagrower.data.event.PlantsCut();
      event.setDate(date);
      plantation.getEvents().store(event);
     
      date=new java.util.Date(date.getTime()+((1000*60)*60)*24);
      event=new net.sf.cannagrower.data.event.EnvironmentAirState();
      event.setDate(date);
      plantation.getEvents().store(event);     
      event=new net.sf.cannagrower.data.event.EnvironmentMediumState();
      event.setDate(date);
      plantation.getEvents().store(event);
     
      date=new java.util.Date(date.getTime()+((1000*60)*60)*24);
      event=new net.sf.cannagrower.data.event.PlantsCut();
      event.setDate(date);
      plantation.getEvents().store(event);
     
      date=new java.util.Date(date.getTime()+((1000*60)*60)*24);
      event=new net.sf.cannagrower.data.event.PlantsHarvest();
      event.setDate(date);
      plantation.getEvents().store(event);
     
      culture.getPlantations().store(plantation);
     
      culture.setModified(false);
      culture.setNew(false);
      break;
    default:
      repository=new TrueZipRepository(new File(Messages.getMessage(Messages.cultureNewName)+CannaGrower.extension));
      repository.setSerializer(XmlSerializer.getSerializer());
      repository.open();
      culture=new Culture(repository);
      culture.repository.read();
      culture.setNew(true);
      culture.setModified(false);
      break;
View Full Code Here

    }
    return culture;
  }
 
  public static Culture read(java.io.File file)throws IOException,ClassNotFoundException{
    TrueZipRepository repository=new TrueZipRepository(new File(file));
    Culture culture;
   
    repository.open();
    repository.read();
   
    culture=new Culture (repository);
   
    culture.setNew(false);
    culture.setModified(false);
View Full Code Here

TOP

Related Classes of net.sf.orexio.lopf.repository.TrueZipRepository

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.