KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jrobin > mrtg > server > Config


1 /* ============================================================
2  * JRobin : Pure java implementation of RRDTool's functionality
3  * ============================================================
4  *
5  * Project Info: http://www.jrobin.org
6  * Project Lead: Sasa Markovic (saxon@jrobin.org);
7  *
8  * (C) Copyright 2003, by Sasa Markovic.
9  *
10  * Developers: Sasa Markovic (saxon@jrobin.org)
11  * Arne Vandamme (cobralord@jrobin.org)
12  *
13  * This library is free software; you can redistribute it and/or modify it under the terms
14  * of the GNU Lesser General Public License as published by the Free Software Foundation;
15  * either version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
18  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19  * See the GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public License along with this
22  * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
23  * Boston, MA 02111-1307, USA.
24  */

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