99 lines
3.4 KiB
Java
99 lines
3.4 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.spy.SpyDir
|
|
* javax.baja.spy.SpyWriter
|
|
*/
|
|
package com.tridium.platform.qnx;
|
|
|
|
import java.io.BufferedReader;
|
|
import java.io.InputStream;
|
|
import java.io.InputStreamReader;
|
|
import java.lang.reflect.Method;
|
|
import javax.baja.spy.SpyDir;
|
|
import javax.baja.spy.SpyWriter;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class QnxCmdPage
|
|
extends SpyDir {
|
|
private String name;
|
|
private String cmd;
|
|
static /* synthetic */ Class class$javax$baja$spy$SpyWriter;
|
|
|
|
public void write(SpyWriter spyWriter) throws Exception {
|
|
try {
|
|
if (this.cmd.equalsIgnoreCase("jmxinfo")) {
|
|
try {
|
|
Class<?> clazz = Class.forName("com.tridium.platform.qnx.se.QnxJmxInfo");
|
|
Class[] classArray = new Class[1];
|
|
Class clazz2 = class$javax$baja$spy$SpyWriter;
|
|
if (clazz2 == null) {
|
|
clazz2 = class$javax$baja$spy$SpyWriter = QnxCmdPage.class("[Ljavax.baja.spy.SpyWriter;", false);
|
|
}
|
|
classArray[0] = clazz2;
|
|
Method method = clazz.getMethod("dumpJmxInfo", classArray);
|
|
method.invoke(clazz, spyWriter);
|
|
}
|
|
catch (Throwable throwable) {}
|
|
} else {
|
|
Runtime runtime = Runtime.getRuntime();
|
|
Process process = runtime.exec(this.cmd);
|
|
InputStream inputStream = process.getInputStream();
|
|
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
|
|
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
|
|
spyWriter.startTable(false);
|
|
spyWriter.trTitle((Object)this.name, 1);
|
|
spyWriter.endTable();
|
|
spyWriter.w((Object)"<pre>\n");
|
|
String string = bufferedReader.readLine();
|
|
while (string != null) {
|
|
spyWriter.safe(this.convertBogusChars(string)).w((Object)"\n");
|
|
string = bufferedReader.readLine();
|
|
}
|
|
spyWriter.w((Object)"</pre>\n");
|
|
bufferedReader.close();
|
|
inputStreamReader.close();
|
|
inputStream.close();
|
|
}
|
|
}
|
|
catch (Exception exception) {}
|
|
}
|
|
|
|
private final String convertBogusChars(String string) {
|
|
StringBuffer stringBuffer = new StringBuffer();
|
|
char[] cArray = string.toCharArray();
|
|
int n = 0;
|
|
while (n < cArray.length) {
|
|
if (cArray[n] == '\t') {
|
|
stringBuffer.append(" ");
|
|
} else if (cArray[n] != '\u0000') {
|
|
stringBuffer.append(cArray[n]);
|
|
}
|
|
++n;
|
|
}
|
|
return stringBuffer.toString();
|
|
}
|
|
|
|
static /* synthetic */ Class class(String string, boolean bl) {
|
|
try {
|
|
Class<?> clazz = Class.forName(string);
|
|
if (!bl) {
|
|
clazz = clazz.getComponentType();
|
|
}
|
|
return clazz;
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
|
|
public QnxCmdPage(String string, String string2) {
|
|
this.name = string;
|
|
this.cmd = string2;
|
|
}
|
|
}
|
|
|