16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 package jdk.test.lib;
25
26 import java.io.File;
27 import java.io.IOException;
28 import java.io.RandomAccessFile;
29 import java.util.regex.Pattern;
30 import java.security.AccessController;
31 import java.security.PrivilegedAction;
32 import java.security.PrivilegedActionException;
33 import java.security.PrivilegedExceptionAction;
34
35 public class Platform {
36 // Use this property to specify docker location on your system.
37 // E.g.: "/usr/local/bin/docker". We define this constant here so
38 // that it can be used in VMProps as well which checks docker support
39 // via this command
40 public static final String DOCKER_COMMAND =
41 System.getProperty("jdk.test.docker.command", "docker");
42 public static final String vmName = privilegedGetProperty("java.vm.name");
43 public static final String vmInfo = privilegedGetProperty("java.vm.info");
44 private static final String osVersion = privilegedGetProperty("os.version");
45 private static int osVersionMajor = -1;
46 private static int osVersionMinor = -1;
47 private static final String osName = privilegedGetProperty("os.name");
48 private static final String dataModel = privilegedGetProperty("sun.arch.data.model");
49 private static final String vmVersion = privilegedGetProperty("java.vm.version");
50 private static final String jdkDebug = privilegedGetProperty("jdk.debug");
51 private static final String osArch = privilegedGetProperty("os.arch");
52 private static final String userName = privilegedGetProperty("user.name");
53 private static final String compiler = privilegedGetProperty("sun.management.compiler");
54
55 private static String privilegedGetProperty(String key) {
56 return AccessController.doPrivileged((
57 PrivilegedAction<String>) () -> System.getProperty(key));
58 }
59
60 public static boolean isClient() {
61 return vmName.endsWith(" Client VM");
|
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 package jdk.test.lib;
25
26 import java.io.File;
27 import java.io.IOException;
28 import java.io.RandomAccessFile;
29 import java.util.regex.Pattern;
30 import java.security.AccessController;
31 import java.security.PrivilegedAction;
32 import java.security.PrivilegedActionException;
33 import java.security.PrivilegedExceptionAction;
34
35 public class Platform {
36 public static final String vmName = privilegedGetProperty("java.vm.name");
37 public static final String vmInfo = privilegedGetProperty("java.vm.info");
38 private static final String osVersion = privilegedGetProperty("os.version");
39 private static int osVersionMajor = -1;
40 private static int osVersionMinor = -1;
41 private static final String osName = privilegedGetProperty("os.name");
42 private static final String dataModel = privilegedGetProperty("sun.arch.data.model");
43 private static final String vmVersion = privilegedGetProperty("java.vm.version");
44 private static final String jdkDebug = privilegedGetProperty("jdk.debug");
45 private static final String osArch = privilegedGetProperty("os.arch");
46 private static final String userName = privilegedGetProperty("user.name");
47 private static final String compiler = privilegedGetProperty("sun.management.compiler");
48
49 private static String privilegedGetProperty(String key) {
50 return AccessController.doPrivileged((
51 PrivilegedAction<String>) () -> System.getProperty(key));
52 }
53
54 public static boolean isClient() {
55 return vmName.endsWith(" Client VM");
|