public void writeTo(OutputStream os) { if (!available()) { throw new IllegalStateException(MESSAGE_FILE_MOVED); } try { IoUtils.copy(new FileInputStream(diskFile), os); } catch (IOException e) { throw new RuntimeException(e); } }
public String getFileContent(String charset) { if (!available()) { throw new IllegalStateException(MESSAGE_FILE_MOVED); } return IoUtils.toString(diskFile, charset); }