要列出的文件
/* NowJava.com - 时 代 Java */ //package com.nowjava; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.ArrayList; import java.util.List; public class Main { public static List<String> fileToList(File file, boolean toLowerCase, boolean trim) { try { /* from N o w J a v a . c o m */ List<String> list = new ArrayList<String>(); BufferedReader br = new BufferedReader(new FileReader(file)); String line = ""; while ((line = br.readLine()) != null) { if (toLowerCase) list.add(line.toLowerCase()); else if (trim) list.add(line.trim());