JAVA读取ini文件的一个类,存着以备后用!
package com.qiao.java;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Properties;
import org.jboss.util.Primitives;
import com.yamu.basic.StringUtils;
public class IniReader {
protected HashMap sections = new LinkedHashMap();
private transient String currentSecion;
private transient Properties current;
private final String filePath=ConfigUtil.getInstance().getValue("config_ini_filepath");
public static IniReader iniFile=new IniReader();
public static IniReader getInstance(){
return iniFile;
}
private IniReader() {}
private void read() throws IOException {
// modifyed by brmrk
BufferedReader reader = new BufferedReader(new InputStreamReader(
new FileInputStream(filePath), "UTF-8"));
String line;
while ((line = reader.readLine()) != null) {
parseLine(line);
}
reader.close();
}
/**
* 描述:处理读取ini文件的每一行
* @author: erguai123@yahoo.com.cn
* @createtime: 2010-5-11 下午02:53:36
*/
protected void parseLine(String line) {
line = line.trim();
if (line.matches("
相关文档:
在Eclipse中连上javadocs文档
一、 安装Eclipse
二、 从Oracle官网或者sun以前的官网上下载Java相应的docs文档
三、 & ......
数据库表单的创建
mysql> create database shuishengmu;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql & ......
在博客园上看到这样的代码,把它打包成一个exe文件
public class Test
{
public static void main(String[] args)
{
String str="C:\\Program Files\\Tencent\\TM2009\\Bin\\TM.exe";
......
某知名门户网站的一道笔试题
public class Test {
public static void stringUpd(String str) {
str = str.replace("j", "l");
System.out.println(str);
}
public static void stringBufferUpd(StringBuffer bf) {
bf.append("c");
System.out.println(bf);
}
......
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet. ......