@Override public void delete(Book dead) throws BookException { SwordBookMetaData sbmd = (SwordBookMetaData) dead.getBookMetaData(); File confFile = sbmd.getConfigFile(); // We can only uninstall what we download into our download dir. if (confFile == null || !confFile.exists()) { // TRANSLATOR: Common error condition: The file could not be deleted. There can be many reasons. // {0} is a placeholder for the file. throw new BookException(JSMsg.gettext("Unable to delete: {0}", confFile)); } // Delete the conf List<File> failures = FileUtil.delete(confFile); if (failures.isEmpty()) { URI loc = sbmd.getLocation(); if (loc != null) { File bookDir = new File(loc.getPath()); failures = FileUtil.delete(bookDir); Books.installed().removeBook(dead); } } // TODO(DM): list all that failed if (!failures.isEmpty()) { // TRANSLATOR: Common error condition: The file could not be deleted. There can be many reasons. // {0} is a placeholder for the file. throw new BookException(JSMsg.gettext("Unable to delete: {0}", failures.get(0))); } }