KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > config > backup > utils > SystemPropsHelper


1 /*
2  * SystemPropsHelper.java
3  *
4  * Created on January 15, 2004, 9:24 PM
5  */

6
7 package com.sun.enterprise.config.backup.utils;
8
9 import com.sun.enterprise.config.backup.utils.LoggerHelper;
10 import com.sun.enterprise.config.backup.DefaultConstants;
11
12 /**
13  *
14  * @author bnevins
15  */

16 public class SystemPropsHelper
17 {
18     public SystemPropsHelper()
19     {
20     }
21
22     public static String JavaDoc getProperty(String JavaDoc what)
23     {
24         String JavaDoc value = System.getProperty(what);
25         
26         if(DefaultConstants.debug)
27         {
28             // this code will not be compiled if debug is false
29
LoggerHelper.fine("READ ENV: " + what + "=" + value);
30             //System.out.println("ENV: " + what + "=" + value);
31
}
32         return value;
33     }
34
35     public static String JavaDoc setProperty(String JavaDoc what, String JavaDoc value)
36     {
37         System.setProperty(what, value);
38         
39         if(DefaultConstants.debug)
40         {
41             // this code will not be compiled if debug is false
42
LoggerHelper.fine("WRITE ENV: " + what + "=" + value);
43             //System.out.println("ENV: " + what + "=" + value);
44
}
45         return value;
46     }
47 }
48
Popular Tags