📄 wktempconffile.java
字号:
package jp.co.sjts.gsession.work;
/*
* Work 偺XXXX WKTempConfFile.java
* Copyright (C) 1999-2000 Japan Total System Co,LTD
* Masakatu O <ookubo@sjts.co.jp>
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;
import jp.co.sjts.gsession.tools.*;
public class WKTempConfFile extends GSTextFile
{
private int TempMax; // 彂椶ID偺嵟廔抣
public synchronized int GetTempMax() { return TempMax; }
public synchronized String GetStrTempMax() { return Integer.toString(TempMax); }
public synchronized void SetTempMax(int tempmax) { TempMax = tempmax; }
public synchronized void SetTempMax(String tempmax) { TempMax = Integer.parseInt(tempmax); }
public final static String FILENAME = "configure";
public final static String FILEPATH = "temp";
public final static String PATH = File.separator;
private File file;
public WKTempConfFile(String HomeDir) throws GSException
{
String filePath = HomeDir + FILEPATH + PATH + FILENAME;
this.file = new File(filePath);
if(!file.exists()) { // 僼傽僀儖偑側偄応崌偼丄僨僼僅儖僩抣偱嶌惉
SetTempMax(0);
Save();
}
}
//昁偢偄傞
synchronized protected File GetFile()
{
return file;
}
//昁偢偄傞
synchronized protected void Write(PrintWriter pw) throws GSException
{
pw.println("tempmax=" + GetStrTempMax());
}
//昁偢偄傞
synchronized protected void Read(BufferedReader bf) throws GSException
{
try{
String buf;
for(buf=bf.readLine();buf!=null;buf=bf.readLine()) {
String value = buf.substring(buf.indexOf("=")+1);
if(buf.startsWith("tempmax"))
SetTempMax(value);
}
}catch(IOException e){
throw new GSException("儚乕僋僼儘乕僐儞僼僼傽僀儖偺撉崬傒偵幐攕");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -