From: Sasa M. <sa...@us...> - 2004-05-11 09:02:10
|
Update of /cvsroot/jrobin/src/org/jrobin/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2655/org/jrobin/core Modified Files: Util.java Log Message: Folders reorganized. In other to run MRTG-CLIENT properly, move the files from jrobin/mrtg-res folder to jrobin/res/mrtg folder. Then remove mrtg-res folder. Index: Util.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/Util.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Util.java 26 Apr 2004 22:28:33 -0000 1.14 --- Util.java 11 May 2004 09:02:00 -0000 1.15 *************** *** 47,56 **** /** ! * Class defines various utility functions used in JRobin. * * @author <a href="mailto:sa...@jr...">Sasa Markovic</a> */ public class Util { ! // pattern RRDTool uses to format doubles in XML files static final String PATTERN = "0.0000000000E00"; --- 47,56 ---- /** ! * Class defines various utility functions used in JRobin. * * @author <a href="mailto:sa...@jr...">Sasa Markovic</a> */ public class Util { ! // pattern RRDTool uses to format doubles in XML files static final String PATTERN = "0.0000000000E00"; *************** *** 224,233 **** } private static final File homeDirFile; private static final String homeDirPath; static { ! String delim = System.getProperty("file.separator"); ! homeDirPath = System.getProperty("user.home") + delim + JROBIN_DIR + delim; homeDirFile = new File(homeDirPath); } --- 224,248 ---- } + /** + * Returns file system separator string. + * @return File system separator ("/" on Unix, "\" on Windows) + */ + public static String getFileSeparator() { + return System.getProperty("file.separator"); + } + + /** + * Returns path to user's home directory. + * @return Path to users home directory, with file separator appended. + */ + public static String getUserHomeDirectory() { + return System.getProperty("user.home") + getFileSeparator(); + } + private static final File homeDirFile; private static final String homeDirPath; static { ! homeDirPath = getUserHomeDirectory() + JROBIN_DIR + getFileSeparator(); homeDirFile = new File(homeDirPath); } *************** *** 355,359 **** return getChildValue( parentNode, childName, true ); } ! static String getChildValue( Node parentNode, String childName, boolean trim ) throws RrdException { NodeList children = parentNode.getChildNodes(); --- 370,374 ---- return getChildValue( parentNode, childName, true ); } ! static String getChildValue( Node parentNode, String childName, boolean trim ) throws RrdException { NodeList children = parentNode.getChildNodes(); *************** *** 371,375 **** return getValue( node, true ); } ! static String getValue(Node node, boolean trimValue ) { String value = null; --- 386,390 ---- return getValue( node, true ); } ! static String getValue(Node node, boolean trimValue ) { String value = null; |