1 23 24 package org.cofax.util; 25 26 import org.cofax.XMLConfig; 27 28 class InitVars { 29 30 public String URL_TO_GET; 31 32 public String FILE_TO_WRITE; 33 34 public String TEMPLATE_FILENAME; 35 36 public String ARTICLE_FILENAME; 37 38 public String SECTION; 39 40 public String PUB_NAME; 41 42 public InitVars(String configFilename) { 43 try { 44 XMLConfig configFile = new XMLConfig(); 45 configFile.setXMLFileName(configFilename); 46 configFile.load(); 47 48 53 URL_TO_GET = configFile.getString("urlToGet"); 56 FILE_TO_WRITE = configFile.getString("fileToWrite"); 57 TEMPLATE_FILENAME = configFile.getString("templateFilename"); 58 ARTICLE_FILENAME = configFile.getString("articleFilename"); 59 SECTION = configFile.getString("section"); 60 PUB_NAME = configFile.getString("pubName"); 61 62 } catch (Exception e) { 63 64 System.err.println("Error reading configuration:"); 65 e.printStackTrace(System.err); 66 67 } 68 } 69 } 70 | Popular Tags |