add vendorName, make all os.name the same values we use elsewhere

This commit is contained in:
Doug MacEachern 2005-06-16 21:58:28 +00:00
parent 2dd2735b24
commit 61ebe669e7
1 changed files with 9 additions and 0 deletions

View File

@ -20,6 +20,7 @@ public class OperatingSystem {
private String patchLevel; private String patchLevel;
private String vendor; private String vendor;
private String vendorVersion; private String vendorVersion;
private String vendorName;
private String dataModel; private String dataModel;
private String cpuEndian; private String cpuEndian;
@ -31,6 +32,7 @@ public class OperatingSystem {
OperatingSystem os = new OperatingSystem(); OperatingSystem os = new OperatingSystem();
Properties props = System.getProperties(); Properties props = System.getProperties();
os.name = props.getProperty("os.name"); os.name = props.getProperty("os.name");
os.vendorName = os.name;
os.version = props.getProperty("os.version"); os.version = props.getProperty("os.version");
os.arch = props.getProperty("os.arch"); os.arch = props.getProperty("os.arch");
os.patchLevel = props.getProperty("sun.os.patch.level"); os.patchLevel = props.getProperty("sun.os.patch.level");
@ -64,6 +66,7 @@ public class OperatingSystem {
os.name = "Solaris"; os.name = "Solaris";
} }
else if (os.name.equals("HP-UX")) { else if (os.name.equals("HP-UX")) {
os.name = "HPUX";
os.vendor = "Hewlett-Packard"; os.vendor = "Hewlett-Packard";
if (os.version.indexOf(".11.") != -1) { if (os.version.indexOf(".11.") != -1) {
os.vendorVersion = "11"; os.vendorVersion = "11";
@ -77,6 +80,7 @@ public class OperatingSystem {
os.vendor = "IBM"; os.vendor = "IBM";
} }
else if (os.name.equals("Mac OS X")) { else if (os.name.equals("Mac OS X")) {
os.name = "Darwin";
os.vendor = "Apple"; os.vendor = "Apple";
} }
else if (os.name.equals("FreeBSD")) { else if (os.name.equals("FreeBSD")) {
@ -120,6 +124,10 @@ public class OperatingSystem {
return this.vendorVersion; return this.vendorVersion;
} }
public String getVendorName() {
return this.vendorName;
}
public String getDataModel() { public String getDataModel() {
return this.dataModel; return this.dataModel;
} }
@ -252,6 +260,7 @@ public class OperatingSystem {
System.out.println("arch............." + os.arch); System.out.println("arch............." + os.arch);
System.out.println("patch level......" + os.patchLevel); System.out.println("patch level......" + os.patchLevel);
System.out.println("vendor..........." + os.vendor); System.out.println("vendor..........." + os.vendor);
System.out.println("vendor name......" + os.vendorName);
System.out.println("vendor version..." + os.vendorVersion); System.out.println("vendor version..." + os.vendorVersion);
} }
} }