1 package org.enhydra.server; 2 3 import org.enhydra.util.ConfigFileInterface; 4 5 import com.lutris.util.Config; 6 import com.lutris.util.KeywordValueException; 7 8 9 17 18 19 20 public class PresentationEdit { 21 22 private String cacheClasses; 23 private String cacheFiles; 24 25 private Config orgconfig ; 26 private Config config; 27 28 public PresentationEdit(Config pmConfig) throws KeywordValueException{ 29 orgconfig = pmConfig; 30 config = pmConfig; 31 if (config != null) { 32 config = (Config) config.getSection("PresentationManager."); 33 if (config.containsKey("CacheClasses")) cacheClasses = config.getString("CacheClasses"); 34 if (config.containsKey("CacheFiles")) cacheFiles = config.getString("CacheFiles"); 35 config = orgconfig; 36 } 37 38 } 39 40 public String getCacheClasses() { 41 return cacheClasses; 42 } 43 public void setCacheClasses(String cacheClasses) throws KeywordValueException{ 44 this.cacheClasses = cacheClasses; 45 config.set("PresentationManager.CacheClasses",cacheClasses); 46 } 47 public void setCacheFiles(String cacheFiles) throws KeywordValueException{ 48 this.cacheFiles = cacheFiles; 49 config.set("PresentationManager.CacheFiles",cacheFiles); 50 } 51 public String getCacheFiles() { 52 return cacheFiles; 53 } 54 55 59 60 public boolean saveState() { 61 try{ 62 ConfigFileInterface confFile = orgconfig.getConfigFile(); 63 confFile.write(); 64 }catch(Exception e){ 65 return false; 66 } 67 return true; 68 } 69 70 } | Popular Tags |