private void initIncFile() { try { File tempIncfile = new File(SwordUtil.getExpandedDataPath(getBookMetaData()).getPath() + File.separator + INCFILE); if (tempIncfile.exists()) { this.incfile = tempIncfile; } } catch (BookException e) { LOGGER.error("Error on checking incfile: {}", e.getMessage(), e); this.incfile = null; } }
private void ensureNotShuttingDown() throws BookException { if (shuttingDown) { throw new BookException("Unable to read book, application is shutting down."); } }
} catch (BookException e) { System.err.println("Error while doing lookup"); e.printStackTrace(); } catch (NoSuchKeyException e) { System.err.println("Error while doing lookup");
rawText = book.getRawText(currentVerse); } catch (BookException e) { if(e.getMessage().startsWith("Unable to obtain raw content")) { rawText = ""; usc.printStackTrace(); } catch (BookException be) { be.printStackTrace();
} catch (BookException e) { System.err.println("Unable to re-index book."); e.printStackTrace(); } catch (BookException e) { System.err.println("Unable to delete index for book."); e.printStackTrace();
public void delete(Book dead) throws BookException { throw new BookException(JSOtherMsg.lookupText("This Book is read-only.")); }
} catch (BookException e) { e.printStackTrace(); } finally { OpenFileStateManager.instance().release(state);
orig = book.getRawText(key); } catch (BookException ex) { log.warn("Failed to read: {}({}):{}", book.getInitials(), key.getOsisID(), ex.getMessage(), ex); return;
public Book create(Book source) throws BookException { throw new BookException(JSOtherMsg.lookupText("This Book is read-only.")); }
} catch (BookException e) { System.err.println("Error while exporting"); e.printStackTrace();
public final Key getGlobalKeyList() { if (global == null) { try { global = getBackend().getGlobalKeyList(); return global; } catch (UnsupportedOperationException ex) { // fail silently, operation not supported by the backend log.debug(ex.getMessage()); } catch (BookException ex) { // failing silently, as previous behavior was to attempt to // return as much as we can using the slower method log.debug(ex.getMessage()); } Versification v11n = super.getVersification(); global = super.createEmptyKeyList(); Key all = PassageKeyFactory.instance().getGlobalKeyList(v11n); for (Key key : all) { if (contains(key)) { global.addAll(key); } } } return global; }
public void setRawText(Key key, String rawData) throws BookException { throw new BookException(JSOtherMsg.lookupText("This Book is read-only.")); }
} catch (BookException e) { e.printStackTrace(); } finally { OpenFileStateManager.instance().release(state);
@Override protected String getEntry(RawBackendState state, String name, Testament testament, long index) throws IOException { RandomAccessFile idxRaf; RandomAccessFile txtRaf; idxRaf = state.getIdxRaf(testament); txtRaf = state.getTextRaf(testament); DataIndex dataIndex = getIndex(idxRaf, index); int size = dataIndex.getSize(); if (size == 0) { return ""; } if (size < 0) { log.error("In {}: Verse {} has a bad index size of {}.", getBookMetaData().getInitials(), name, Integer.toString(size)); return ""; } try { File dataFile = getDataTextFile(txtRaf, dataIndex); byte[] textBytes = readTextDataFile(dataFile); decipher(textBytes); return SwordUtil.decode(name, textBytes, getBookMetaData().getBookCharset()); } catch (BookException e) { throw new IOException(e.getMessage()); } }
public void setRawText(Key key, String rawData) throws BookException { throw new BookException(JSOtherMsg.lookupText("This Book is read-only.")); }
} catch (BookException e) { e.printStackTrace(); } finally { OpenFileStateManager.instance().release(state);
public void setAliasKey(Key alias, Key source) throws BookException { throw new BookException(JSOtherMsg.lookupText("This Book is read-only.")); }
installer.deleteBook(b); } catch (BookException e) { e.printStackTrace(); installer.installBook(args[1], b); } catch (BookException e) { e.printStackTrace(); } catch (InstallException e) { e.printStackTrace();
public void setRawText(Key key, String rawData) throws BookException { throw new BookException(JSOtherMsg.lookupText("This Book is read-only.")); }