- /**
- * Import the story into the local reader library, and keep the same LUID.
- *
- * @param luid
- * the Library UID
- * @param pg
- * the optional progress reporter
- *
- * @throws IOException
- * in case of I/O error
- */
- public void imprt(String luid, Progress pg) throws IOException {
- Progress pgGetStory = new Progress();
- Progress pgSave = new Progress();
- if (pg != null) {
- pg.setMax(2);
- pg.addProgress(pgGetStory, 1);
- pg.addProgress(pgSave, 1);
- }
-
- try {
- Story story = getLibrary().getStory(luid, pgGetStory);
- if (story != null) {
- story = localLibrary.save(story, luid, pgSave);
- } else {
- throw new IOException("Cannot find story in Library: " + luid);
- }
- } catch (IOException e) {
- throw new IOException(
- "Cannot import story from library to LocalReader library: "
- + luid, e);
- }
- }
-