Ejemplo n.º 1
0
  private void deleteBook(Book book) {
    System.out.println("Deleting:" + book.getInitials() + " name:" + book.getName());
    try {
      IndexManager imanager = IndexManagerFactory.getIndexManager();
      if (imanager.isIndexed(book)) {
        imanager.deleteIndex(book);
      }

      book.getDriver().delete(book);
    } catch (Exception e) {
      System.out.println("Failed to delete " + book.getInitials() + ":" + e.getMessage());
      e.printStackTrace();
    }
  }
Ejemplo n.º 2
0
  private void indexSingleBook(String initials) {
    try {
      Book book = BookInstaller.getInstalledBook(initials);

      IndexManager imanager = IndexManagerFactory.getIndexManager();
      if (imanager.isIndexed(book)) {
        imanager.deleteIndex(book);
      }

      indexBook(book);
      createZipFile(book);
    } catch (Exception e) {
      System.out.println("Error indexing:" + initials);
      e.printStackTrace();
    }
  }