< prev index next >

src/com/sun/javatest/exec/template/TemplateSession.java

Print this page




  81     public String getValue(String name) {
  82         if (TEMPLATE_PROP_NAME.equals(name)) {
  83             if (templ == null) {
  84                 return null;
  85             }
  86             File f = templ.getFile();
  87             return f == null ?  null : f.getPath();
  88         } else {
  89             return super.getValue(name);
  90         }
  91     }
  92 
  93 
  94     @Override
  95     public void dispose() {
  96         templ.dispose();
  97         super.dispose();
  98     }
  99 
 100     @Override
 101     public void save(Map map) {
 102         if (templ.getFile() != null) {
 103             map.put("template", templ.getFile().getPath());
 104         }
 105         super.save(map);
 106     }
 107 
 108 
 109     @Override
 110     public void restore(Map map) throws Fault {
 111         super.restore(map);
 112         restoreTemplate(map);
 113     }
 114 
 115     protected void restoreTemplate(Map map) {
 116         String templPath = (String) map.get("template");
 117         if (templPath != null) {
 118             try {
 119                 if (!new File(templPath).exists() && getWorkDirectory() != null) {
 120                     // attempt to find relocated template
 121                     String oldWDpath = getWorkDirectory().getPrevWDPath();




  81     public String getValue(String name) {
  82         if (TEMPLATE_PROP_NAME.equals(name)) {
  83             if (templ == null) {
  84                 return null;
  85             }
  86             File f = templ.getFile();
  87             return f == null ?  null : f.getPath();
  88         } else {
  89             return super.getValue(name);
  90         }
  91     }
  92 
  93 
  94     @Override
  95     public void dispose() {
  96         templ.dispose();
  97         super.dispose();
  98     }
  99 
 100     @Override
 101     public void save(Map<String, String> map) {
 102         if (templ.getFile() != null) {
 103             map.put("template", templ.getFile().getPath());
 104         }
 105         super.save(map);
 106     }
 107 
 108 
 109     @Override
 110     public void restore(Map map) throws Fault {
 111         super.restore(map);
 112         restoreTemplate(map);
 113     }
 114 
 115     protected void restoreTemplate(Map map) {
 116         String templPath = (String) map.get("template");
 117         if (templPath != null) {
 118             try {
 119                 if (!new File(templPath).exists() && getWorkDirectory() != null) {
 120                     // attempt to find relocated template
 121                     String oldWDpath = getWorkDirectory().getPrevWDPath();


< prev index next >