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

📄 custom.java

📁 sifi-0.1.6.tar.gz 出自http://www.ifi.unizh.ch/ikm/SINUS/firewall/ 一个linux的防火墙工具。
💻 JAVA
字号:
/* ----------------------------------------------------------------------   The SINUS Firewall -- a TCP/IP packet filter for Linux   Written within the SINUS project at the University of Zurich,   SWITCH, Telekurs Payserv AG, ETH Zurich.   originally based on the sf Firewall Software (C) 1996 by Robert   Muchsel and Roland Schmid.   This program is free software; you can redistribute it and/or modify   it under the terms of the GNU General Public License as published by   the Free Software Foundation; either version 2 of the License, or   (at your option) any later version.   This program is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   GNU General Public License for more details.   You should have received a copy of the GNU General Public License   along with this program; if not, write to the Free Software   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.   SINUS Firewall resources:   SINUS Homepage: http://www.ifi.unizh.ch/ikm/SINUS/   Firewall Homepage: http://www.ifi.unizh.ch/ikm/SINUS/firewall.html   Frequently asked questions: http://www.ifi.unizh.ch/ikm/SINUS/sf_faq.html   Mailing list for comments, questions, bug reports: firewall@ifi.unizh.ch   ----------------------------------------------------------------------  */package sfclasses;import java.util.*;import java.io.*;/** * This class contains all user customizable parameters like paths  * and filenames. * @version 1.0 13 Dec 1996 * @author Roland E. Schmid */public class Custom extends Properties {  public Custom() {    String osName = System.getProperty("os.name");    if (osName.equals("OS/2") || osName.equals("Windows 95")) {			TMP_DIR = "tmp\\";		}    else { // default			TMP_DIR = "/home/stock/sf/devel/tmp/";		}		put("CONF_DIR",					"/etc/firewall.d/");		put("LOG_DIR", 					"/var/log/");		put("LOG",							"firewall");		put("SPY_LOG",					"firewall.spy");		put("REPORT",						"firewall.report");		put("GLOBAL_CONFIG",		"firewall.global");		put("GENERATE_CONFIG",	"firewall.conf.new");		put("TMP_DIR",					TMP_DIR);			  }	public boolean save() {		FileOutputStream fos;		try {			fos = new FileOutputStream("sfControl.ini");			String s = new String("\n# Automatically generated by sfControl\n#\n");			this.save(fos, s);			fos.close();			return true;		}		catch (Exception e) {			return false;		}	} // save	public boolean load() {		FileInputStream fis;		try {			fis = new FileInputStream("sfControl.ini");			this.load(fis);			return true;		}		catch (Exception e) {			return false;		}	} // load	private static String TMP_DIR;} // Custom

⌨️ 快捷键说明

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