📄 config.java
字号:
/*
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
author: Yuan yongfu lijin liyong lib 511,the College of Mathematics and Computer Science,HuNan Normal University,China
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
*/
package edu.hunnu.webjetchecker.config;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.io.StringReader;
/**
* @author yyf
*
* TODO To change the template for this generated type comment go to Window -
* Preferences - Java - Code Style - Code Templates
*/
public class Config {
private String mwb_path = null;
public Config() {
}
/**
* @return
*/
public String getMwb_path() {
// TODO Auto-generated method stub
File file = new File("config/config.xml");
try {
RandomAccessFile ra = new RandomAccessFile(file, "r");
String path = ra.readLine();
ra.close();
this.mwb_path = new String(path.getBytes("8859_1"), "gb2312");
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
return this.mwb_path;
}
public void setMwb_path(String mwb_path) {
File file = new File("config/config.xml");
int length = 0;
try {
StringReader sr = new StringReader(mwb_path);
FileWriter out = new FileWriter(file);
char b[] = new char[10000];
length = sr.read(b, 0, 10000);
out.write(b, 0, length);
out.flush();
out.close();
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -