1 25 package org.jrobin.mrtg.server; 26 27 import org.jrobin.mrtg.MrtgConstants; 28 29 import java.io.File ; 30 31 class Config implements MrtgConstants { 32 private static final String DELIM = System.getProperty("file.separator"); 34 private static final String HOME_DIR = System.getProperty("user.home") + DELIM + 35 "mrtg" + DELIM; 36 private static final String CONF_DIR = HOME_DIR + "conf" + DELIM; 37 private static final String RRD_DIR = HOME_DIR + "rrd" + DELIM; 38 private static final String HARDWARE_FILE = CONF_DIR + "mrtg.dat"; 39 private static final String RRD_DEF_TEMPLATE_FILE = CONF_DIR + "rrd_template.xml"; 40 private static final String RRD_GRAPH_DEF_TEMPLATE_FILE = CONF_DIR + "graph_template.xml"; 41 42 static { 43 new File (CONF_DIR).mkdirs(); 45 new File (RRD_DIR).mkdirs(); 46 } 47 48 static String getHomeDir() { 49 return HOME_DIR; 50 } 51 52 static String getConfDir() { 53 return CONF_DIR; 54 } 55 56 static String getRrdDir() { 57 return RRD_DIR; 58 } 59 60 static String getHardwareFile() { 61 return HARDWARE_FILE; 62 } 63 64 static String getRrdTemplateFile() { 65 return RRD_DEF_TEMPLATE_FILE; 66 } 67 68 static String getGraphTemplateFile() { 69 return RRD_GRAPH_DEF_TEMPLATE_FILE; 70 } 71 } 72 | Popular Tags |