1 // Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
2 // Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
3 // Decompiler options: packimports(3)
4 // Source File Name: System.java
11 // Referenced classes of package java.lang:
12 // Object, Runtime, RuntimePermission, SecurityManager,
13 // String, IllegalArgumentException, Error, StringBuffer
15 public final class System
22 public static void setIn(InputStream in)
24 SecurityManager sm = Runtime.securityManager;
26 sm.checkPermission(new RuntimePermission("setIO"));
30 public static void setOut(PrintStream out)
32 SecurityManager sm = Runtime.securityManager;
34 sm.checkPermission(new RuntimePermission("setIO"));
38 public static void setErr(PrintStream err)
40 SecurityManager sm = Runtime.securityManager;
42 sm.checkPermission(new RuntimePermission("setIO"));
46 public static synchronized void setSecurityManager(SecurityManager sm)
48 if(Runtime.securityManager != null)
49 Runtime.securityManager.checkPermission(new RuntimePermission("setSecurityManager"));
50 Runtime.securityManager = sm;
53 public static SecurityManager getSecurityManager()
55 return Runtime.securityManager;
58 public static native long currentTimeMillis();
60 public static native void arraycopy(Object obj, int i, Object obj1, int j, int k);
62 public static native int identityHashCode(Object obj);
64 public static Properties getProperties()
66 SecurityManager sm = Runtime.securityManager;
68 sm.checkPropertiesAccess();
72 public static void setProperties(Properties properties)
74 SecurityManager sm = Runtime.securityManager;
76 sm.checkPropertiesAccess();
77 if(properties == null)
78 properties = (Properties)Runtime.defaultProperties.clone();
79 properties = properties;
82 public static String getProperty(String key)
84 SecurityManager sm = Runtime.securityManager;
86 sm.checkPropertyAccess(key);
89 throw new IllegalArgumentException("key can't be empty");
90 return properties.getProperty(key);
93 public static String getProperty(String key, String def)
95 SecurityManager sm = Runtime.securityManager;
97 sm.checkPropertyAccess(key);
98 return properties.getProperty(key, def);
101 public static String setProperty(String key, String value)
103 SecurityManager sm = Runtime.securityManager;
105 sm.checkPermission(new PropertyPermission(key, "write"));
106 return (String)properties.setProperty(key, value);
109 public static String getenv(String name)
111 throw new Error("getenv no longer supported, use properties instead: " + name);
114 public static void exit(int status)
116 Runtime.getRuntime().exit(status);
119 public static void gc()
121 Runtime.getRuntime().gc();
124 public static void runFinalization()
126 Runtime.getRuntime().runFinalization();
129 public static void runFinalizersOnExit(boolean finalizeOnExit)
131 Runtime.getRuntime();
134 public static void load(String filename)
136 Runtime.getRuntime().load(filename);
139 public static void loadLibrary(String libname)
141 Runtime.getRuntime().loadLibrary(libname);
144 public static String mapLibraryName(String libname)
146 return Runtime.nativeGetLibname("", libname);
149 static native boolean isWordsBigEndian();
151 private static native void setIn0(InputStream inputstream);
153 private static native void setOut0(PrintStream printstream);
155 private static native void setErr0(PrintStream printstream);
157 private static Properties properties;
158 public static final InputStream in;
159 public static final PrintStream out;
160 public static final PrintStream err;
164 Properties defaultProperties = Runtime.defaultProperties;
165 if(defaultProperties.get("gnu.classpath.home.url") == null)
166 defaultProperties.put("gnu.classpath.home.url", "file://" + defaultProperties.get("gnu.classpath.home") + "/lib");
167 if(defaultProperties.get("gnu.classpath.vm.shortname") == null)
169 String value = defaultProperties.getProperty("java.vm.name");
170 int index = value.lastIndexOf(32);
172 value = value.substring(index + 1);
173 defaultProperties.put("gnu.classpath.vm.shortname", value);
175 defaultProperties.put("gnu.cpu.endian", isWordsBigEndian() ? "big" : "little");
176 if(defaultProperties.get("java.io.tmpdir") == null)
177 defaultProperties.put("java.io.tmpdir", defaultProperties.get("java.tmpdir"));
178 properties = (Properties)Runtime.defaultProperties.clone();
179 in = new BufferedInputStream(new FileInputStream(FileDescriptor.in));
180 out = new PrintStream(new BufferedOutputStream(new FileOutputStream(FileDescriptor.out)), true);
181 err = new PrintStream(new BufferedOutputStream(new FileOutputStream(FileDescriptor.err)), true);