- String source = null;
- for (File infoFile : infoFiles) {
- pgFiles.setName(infoFile.getName());
- try {
- MetaData meta = InfoReader
- .readMeta(infoFile, false);
- source = meta.getSource();
- try {
- int id = Integer.parseInt(meta.getLuid());
- if (id > lastId) {
- lastId = id;
- }
-
- stories.put(meta, new File[] { infoFile,
- getTargetFile(meta, infoFile) });
- } catch (Exception e) {
- // not normal!!
- throw new IOException(
- "Cannot understand the LUID of "
- + infoFile + ": "
- + meta.getLuid(), e);
- }
- } catch (IOException e) {
- // We should not have not-supported files in the
- // library
- Instance.getTraceHandler().error(
- new IOException(
- "Cannot load file from library: "
- + infoFile, e));
- }
- pgFiles.add(1);
- }
-
- File cover = new File(dir, ".cover.png");
- if (cover.exists()) {
- try {
- InputStream in = new FileInputStream(cover);
- try {
- sourceCovers.put(source, new Image(in));
- } finally {
- in.close();
- }
- } catch (IOException e) {
- Instance.getTraceHandler().error(e);
- }
- }