File: SystemProperties.java

package info (click to toggle)
tya 1.6-1
  • links: PTS
  • area: contrib
  • in suites: potato
  • size: 628 kB
  • ctags: 843
  • sloc: ansic: 7,028; asm: 618; java: 497; makefile: 88; sh: 18
file content (44 lines) | stat: -rw-r--r-- 1,180 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// some testing stuff for TYA

import java.util.*;

public class SystemProperties 
{
   public static void main (String[] args) 
   {
        System.out.println("This line should be a (c) line ^^^   (else TYA is not loaded.)");
        System.out.println(System.getProperty ("java.compiler"));
        System.out.println(System.getProperty ("os.name"));
	//-----------------------------------------------------------
/*
 // ADD FOR TESTING AFTER THE FIRST TRY
         System.out.println("Hello World .."+new Date().toLocaleString());
        try
        { 
	 int a=0;
         System.out.println(0/a);
        }
        catch  (ArithmeticException ex) 
	{ 
	 System.out.println(ex.toString()+" (Div 0!!!!)");
	}
 	//----------------------------------------------------------

	Properties pp =System.getProperties();
	dumpProp(pp);			
  	Runtime rt=Runtime.getRuntime();
        System.out.println("total Memory="+rt.totalMemory());
*/
   }

   static public void dumpProp(Properties pp)
	{
	   for(Enumeration e = pp.propertyNames() ; e.hasMoreElements(); )
	   {
	    String str = (String)e.nextElement();
	    System.out.println(str+"\t=\t"+pp.getProperty (str));
	   }
	}

}