1 23 package com.sun.enterprise.diagnostics.collect; 24 25 import com.sun.enterprise.diagnostics.Data; 26 import com.sun.enterprise.diagnostics.DiagnosticException; 27 31 public class SystemInfoCollector implements Collector { 32 33 private String destFolder = null; 34 35 public SystemInfoCollector(String destFolder) { 36 this.destFolder = destFolder; 37 } 38 39 43 public Data capture() throws DiagnosticException { 44 Data systemInfo = null; 45 Collector systemInfoCollector = null; 46 String osName = System.getProperty("os.name"); 47 osName = osName.toUpperCase(); 48 49 if (osName.indexOf("WIN") >= 0) { 50 systemInfoCollector = new WindowsSystemInfoCollector(destFolder); 51 } 52 else if (osName.indexOf("SUNOS") >= 0) { 53 systemInfoCollector = new SolarisSystemInfoCollector(destFolder); 54 } else if (osName.indexOf("LINUX") >= 0) { 55 systemInfoCollector = new LinuxSystemInfoCollector(destFolder); 56 } 57 58 if(systemInfoCollector !=null){ 59 systemInfo = systemInfoCollector.capture(); 60 } 61 return systemInfo; 62 } 63 } 64 | Popular Tags |