externalsettings.java

来自「this is a sample of a java bot. use to e」· Java 代码 · 共 38 行

JAVA
38
字号
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

class ExternalSettings {

	public Properties properties = new Properties();

	public boolean load() {
		try {
			FileInputStream in = new FileInputStream(new File(Constants.INI_FILE_LOC));
			this.properties.load(in);
			in.close();
			return true;
		} catch(IOException ioe) {
			return false;
		}
	}

	public boolean save() {
		try {
			FileOutputStream out = new FileOutputStream(new File(Constants.INI_FILE_LOC));
			this.properties.store(out, null);
			out.close();
			return true;
		} catch(IOException ioe) {
			return false;
		}
	}

	public boolean iniExists() {
		File file = new File(Constants.INI_FILE_LOC);
		return (file.exists() && !file.isDirectory());
	}

}

⌨️ 快捷键说明

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