public class PositionController {
// 读取txt内容
public static String txt2String(File file) {
StringBuilder result = new StringBuilder();
try {
BufferedReader br = new BufferedReader(new FileReader(file));// 构造一个BufferedReader类来读取文件
String s = null;
while ((s = br.readLine()) != null) {// 使用readLine方法,一次读一行
result.append(System.lineSeparator() + s);
}
br.close();
} catch (Exception e) {
e.printStackTrace();
}
return result.toString();
}
// 读取文件夹下所有文件名
public static List getFile(File file) {
List listLocal = new ArrayList<>();
if (file != null) {
File[] f = file.listFiles();
if (f != null) {
for (int i = 0; i < f.length; i++) {