📄 scconfgroupfile.java
字号:
package jp.co.sjts.gsession.schedule;
/*
* Schedule 偺XXXX SCConfGroupFile.java
* Copyright (C) 1999-2000 Japan Total System Co,LTD
*
*/
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.Properties;
import java.util.StringTokenizer;
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Collections;
import jp.co.sjts.gsession.tools.*;
public class SCConfGroupFile extends GSTextFile
{
private int Schemax; // 僗働僕儏乕儖ID嵟廔抣
public synchronized int GetSchemax() { return Schemax; }
public synchronized void SetSchemax(int schemax) { Schemax = schemax; }
//
public final static String FILENAME = "configure";
private Properties properties=null;
private File file;
public SCConfGroupFile(String ScheduleDir,String gid) throws GSException
{
properties = System.getProperties();
String GroupDir = ScheduleDir + gid ;
GroupDir = GroupDir.replace('/',this.properties.getProperty("file.separator").charAt(0));
// 僨傿儗僋僩儕偺桳岠惈傪僠僃僢僋
try{
File file1 = new File(GroupDir);
if(!file1.exists()) // 僼傽僀儖偑懚嵼偡傞偐
{
if(!file1.mkdirs()) // 僼傽僀儖偑懚嵼偟側偄応崌偼丄嶌惉傪帋傒傞
throw new GSException("僨傿儗僋僩儕嶌惉偵帋傒偨偑幐攕偟傑偟偨丅");
}
} catch (SecurityException e) {
throw new GSException("傾僋僙僗尃僄儔乕:"+GroupDir);
}
String filePath = GroupDir + file.separator + FILENAME;
this.file = new File(filePath);
if(!file.exists())
{// 僼傽僀儖偑側偄応崌偼丄僨僼僅儖僩抣偱嶌惉
// 僨僼僅儖僩抣愝掕
SetSchemax(0);
Save();
}
}
public synchronized File GetFile()
{
return file;
}
public synchronized void Write(PrintWriter pw) throws GSException
{
pw.println("schemax=" + GetSchemax());
}
public synchronized 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("schemax"))
SetSchemax(Integer.parseInt(value));
}
}catch(IOException e){
throw new GSException("僗働僕儏乕儖僌儖乕僾僐儞僼僼傽僀儖偺撉崬傒偵幐攕");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -