home *** CD-ROM | disk | FTP | other *** search
/ Print Shop Ensemble 3 / the-print-shop-ensemble-iii.iso / worldnet / disk2 / java.z / MOZ2_01.ZIP / java / lang / System.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-03-08  |  3.4 KB  |  120 lines

  1. package java.lang;
  2.  
  3. import java.io.BufferedInputStream;
  4. import java.io.BufferedOutputStream;
  5. import java.io.FileDescriptor;
  6. import java.io.FileInputStream;
  7. import java.io.FileOutputStream;
  8. import java.io.InputStream;
  9. import java.io.PrintStream;
  10. import java.util.Properties;
  11.  
  12. public final class System {
  13.    // $FF: renamed from: in java.io.InputStream
  14.    public static InputStream field_0;
  15.    public static PrintStream out;
  16.    public static PrintStream err;
  17.    private static SecurityManager security;
  18.    private static Properties props;
  19.  
  20.    private System() {
  21.    }
  22.  
  23.    public static void setSecurityManager(SecurityManager s) {
  24.       if (security != null) {
  25.          throw new SecurityException("SecurityManager already set");
  26.       } else {
  27.          security = s;
  28.       }
  29.    }
  30.  
  31.    public static SecurityManager getSecurityManager() {
  32.       return security;
  33.    }
  34.  
  35.    public static native long currentTimeMillis();
  36.  
  37.    public static native void arraycopy(Object var0, int var1, Object var2, int var3, int var4);
  38.  
  39.    private static native Properties initProperties(Properties var0);
  40.  
  41.    public static Properties getProperties() {
  42.       if (props == null) {
  43.          props = initProperties(new Properties());
  44.       }
  45.  
  46.       if (security != null) {
  47.          security.checkPropertiesAccess();
  48.       }
  49.  
  50.       return props;
  51.    }
  52.  
  53.    public static void setProperties(Properties props) {
  54.       if (security != null) {
  55.          security.checkPropertiesAccess();
  56.       }
  57.  
  58.       System.props = props;
  59.    }
  60.  
  61.    public static String getProperty(String key) {
  62.       if (security != null) {
  63.          security.checkPropertyAccess(key);
  64.       }
  65.  
  66.       if (props == null) {
  67.          props = initProperties(new Properties());
  68.       }
  69.  
  70.       return props.getProperty(key);
  71.    }
  72.  
  73.    public static String getProperty(String key, String def) {
  74.       if (security != null) {
  75.          security.checkPropertyAccess(key);
  76.       }
  77.  
  78.       if (props == null) {
  79.          props = initProperties(new Properties());
  80.       }
  81.  
  82.       return props.getProperty(key, def);
  83.    }
  84.  
  85.    public static String getenv(String name) {
  86.       throw new Error("getenv no longer supported, use properties and -D instead: " + name);
  87.    }
  88.  
  89.    public static void exit(int status) {
  90.       Runtime.getRuntime().exit(status);
  91.    }
  92.  
  93.    // $FF: renamed from: gc () void
  94.    public static void method_0() {
  95.       Runtime.getRuntime().gc();
  96.    }
  97.  
  98.    public static void runFinalization() {
  99.       Runtime.getRuntime().runFinalization();
  100.    }
  101.  
  102.    public static void load(String filename) {
  103.       Runtime.getRuntime().load(filename);
  104.    }
  105.  
  106.    public static void loadLibrary(String libname) {
  107.       Runtime.getRuntime().loadLibrary(libname);
  108.    }
  109.  
  110.    static {
  111.       try {
  112.          field_0 = new BufferedInputStream(new FileInputStream(FileDescriptor.in), 128);
  113.          out = new PrintStream(new BufferedOutputStream(new FileOutputStream(FileDescriptor.out), 128), true);
  114.          err = new PrintStream(new BufferedOutputStream(new FileOutputStream(FileDescriptor.err), 128), true);
  115.       } catch (Exception var0) {
  116.          throw new Error("can't initialize stdio");
  117.       }
  118.    }
  119. }
  120.