private void loadBinary(final CDOLobInfo info) throws IOException { final File file = getDelegate().getBinaryFile(info.getID()); final FileOutputStream out = new FileOutputStream(file); loadLobAsync(info, new Runnable() { public void run() { try { getSessionProtocol().loadLob(info, out); } catch (Throwable t) { OM.LOG.error(t); IOUtil.delete(file); } } }); }
@Override public Reader getCharacter(CDOLobInfo info) throws IOException { for (;;) { try { return super.getCharacter(info); } catch (FileNotFoundException couldNotBeRead) { try { loadCharacter(info); } catch (FileNotFoundException couldNotBeCreated) { // Try to read again } } } }
@Override public Reader getCharacter(CDOLobInfo info) throws IOException { for (;;) { try { return super.getCharacter(info); } catch (FileNotFoundException couldNotBeRead) { try { loadCharacter(info); } catch (FileNotFoundException couldNotBeCreated) { // Try to read again } } } }
@Override public InputStream getBinary(final CDOLobInfo info) throws IOException { for (;;) { try { return super.getBinary(info); } catch (FileNotFoundException couldNotBeRead) { try { loadBinary(info); } catch (FileNotFoundException couldNotBeCreated) { // Try to read again } } } }
private void loadBinary(final CDOLobInfo info) throws IOException { final File file = getDelegate().getBinaryFile(info.getID()); final FileOutputStream out = new FileOutputStream(file); loadLobAsync(info, new Runnable() { public void run() { try { getSessionProtocol().loadLob(info, out); } catch (Throwable t) { OM.LOG.error(t); IOUtil.delete(file); } } }); }
@Override public InputStream getBinary(final CDOLobInfo info) throws IOException { for (;;) { try { return super.getBinary(info); } catch (FileNotFoundException couldNotBeRead) { try { loadBinary(info); } catch (FileNotFoundException couldNotBeCreated) { // Try to read again } } } }
private void loadCharacter(final CDOLobInfo info) throws IOException { final File file = getDelegate().getCharacterFile(info.getID()); final FileWriter out = new FileWriter(file); loadLobAsync(info, new Runnable() { public void run() { try { getSessionProtocol().loadLob(info, out); } catch (Throwable t) { OM.LOG.error(t); IOUtil.delete(file); } } }); }
private void loadCharacter(final CDOLobInfo info) throws IOException { final File file = getDelegate().getCharacterFile(info.getID()); final FileWriter out = new FileWriter(file); loadLobAsync(info, new Runnable() { public void run() { try { getSessionProtocol().loadLob(info, out); } catch (Throwable t) { OM.LOG.error(t); IOUtil.delete(file); } } }); }