📄 licenseinfo.java
字号:
/*
$Author: $
$Date: $
$Revision: $
$NoKeywords: $
*/
package jp.co.ntl;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class LicenseInfo implements java.io.Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private String license;
private String destination;
public final String getLicense() { return license; }
public final void setLicense(String license) { this.license = license; }
public final String getDestination() { return destination; }
public final void setDestination(String destination) { this.destination = destination; }
public void readFromCommand(String command) throws IOException {
int index;
String key, value;
Process p = Runtime.getRuntime().exec(command);
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String s;
while ((s = br.readLine()) != null) {
if ((index = s.indexOf(' ')) == -1) {
break;
}
key = s.substring(0, index);
value = s.substring(index + 1);
put(key, value);
}
br.close();
}
public void put(String key, String value) {
if (key.equals("license")) {
setLicense(value);
} else if (key.equals("destination")) {
setDestination(value);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -