1 17 18 package org.apache.tomcat.jni; 19 20 25 26 public class OS { 27 28 29 private static final int UNIX = 1; 30 private static final int NETWARE = 2; 31 private static final int WIN32 = 3; 32 private static final int WIN64 = 4; 33 private static final int LINUX = 5; 34 private static final int SOLARIS = 6; 35 private static final int BSD = 7; 36 37 public static final int LOG_EMERG = 1; 38 public static final int LOG_ERROR = 2; 39 public static final int LOG_NOTICE = 3; 40 public static final int LOG_WARN = 4; 41 public static final int LOG_INFO = 5; 42 public static final int LOG_DEBUG = 6; 43 44 48 private static native boolean is(int type); 49 50 public static final boolean IS_UNIX = is(UNIX); 51 public static final boolean IS_NETWARE = is(NETWARE); 52 public static final boolean IS_WIN32 = is(WIN32); 53 public static final boolean IS_WIN64 = is(WIN64); 54 public static final boolean IS_LINUX = is(LINUX); 55 public static final boolean IS_SOLARIS = is(SOLARIS); 56 public static final boolean IS_BSD = is(BSD); 57 58 62 public static native String defaultEncoding(long pool); 63 64 70 public static native String localeEncoding(long pool); 71 72 77 public static native int random(byte [] buf, int len); 78 79 106 public static native int info(long [] inf); 107 108 113 public static native String expand(String str); 114 115 119 public static native void sysloginit(String domain); 120 121 126 public static native void syslog(int level, String message); 127 128 } 129 | Popular Tags |