touch-fish
touch-fish copied to clipboard
文件加载
BookSettingsConfigurable.class里加载文件的方法有BUG。 try { List<String> lines = Files.readAllLines(Paths.get(settings.getBookPath(), new String[0])); int totalPage = (lines.size() + settings.getPageSize().intValue() - 1) / settings.getPageSize().intValue(); settings.setTotalPage(Integer.valueOf(totalPage)); settings.setLines(lines); } catch (IOException e) { throw new ConfigurationException("); } 1、文件编码必须要是UTF-8,否则会读取文件失败 2、totalPage 计算有问题,除不尽的时候总页数不对