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(); } }
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(); } }