⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cimainconffile.java

📁 一个日本流行的,功能较全的开源Web办公管理(Groupware)系统。
💻 JAVA
字号:
package jp.co.sjts.gsession.circular;

/*
 * Circulan 偺XXXX  CIMainConfFile.java
 * Copyright (C) 1999-2000 Japan Total System Co,LTD
 *	  Masakatu O	<ookubo@sjts.co.jp>
 */

import java.io.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;
import jp.co.sjts.gsession.tools.*;

public class CIMainConfFile extends GSTextFile
{
	private int CircularMax;			// 夞棗斅ID嵟廔抣

	public synchronized int GetCircularMax() { return CircularMax; }
	public synchronized String GetStrCircularMax() { return  Integer.toString(CircularMax); }

	public synchronized void SetCircularMax(int circularmax) { CircularMax = circularmax; }
	public synchronized void SetCircularMax(String circularmax) { CircularMax = Integer.parseInt(circularmax); }

	public final static String FILENAME = "configure";

	private File file;

	/**
	 * <P>巜掕偝傟偨抣傪尦偵僆僽僕僃僋僩傪嶌惉偟傑偡丅<BR>
	 * <P>巜掕偝傟偨僼傽僀儖僷僗偵configure僼傽僀儖偑懚嵼偟側偐偭偨応崌丄怴婯偵configure僼傽僀儖傪嶌惉偟傑偡丅
	 *
	 * @param HomeDir - 夞棗斅僨乕僞僨傿儗僋僩儕
	 */
	public CIMainConfFile(String HomeDir) throws GSException
	{
		String filePath = HomeDir + FILENAME;
		this.file = new File(filePath);
		
		if(!file.exists()) {		// 僼傽僀儖偑側偄応崌偼丄僨僼僅儖僩抣偱嶌惉
			SetCircularMax(0);
			Save();
		}
	}

//昁偢偄傞
	synchronized protected File GetFile()
	{
		return file;
	}


//昁偢偄傞
	synchronized protected void Write(PrintWriter pw) throws GSException
	{
		pw.println("circularmax=" + GetStrCircularMax());
	}


//昁偢偄傞
	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("circularmax"))
					SetCircularMax(value);
			}
		}catch(IOException e){
			throw new GSException("夞棗斉僐儞僼僼傽僀儖偺撉崬傒偵幐攕");
		}
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -