@Override public void closeAndDelete() throws IOException { try { close(); } finally { deleteChannel(); } }
@Override public void deleteChannel() { if (!isClosed() || this.fileChannel.isOpen()) { throw new IllegalStateException("Cannot delete a channel that is open."); } // make a best effort to delete the file. Don't report exceptions. try { File f = new File(this.id.getPath()); if (f.exists()) { f.delete(); } } catch (Throwable t) {} }
@Override public void deleteChannel() { if (!isClosed() || this.fileChannel.isOpen()) { throw new IllegalStateException("Cannot delete a channel that is open."); } // make a best effort to delete the file. Don't report exceptions. try { File f = new File(this.id.getPath()); if (f.exists()) { f.delete(); } } catch (Throwable t) {} }
@Override public void closeAndDelete() throws IOException { try { close(); } finally { deleteChannel(); } }
@Override public void deleteChannel() { if (!isClosed() || this.fileChannel.isOpen()) { throw new IllegalStateException("Cannot delete a channel that is open."); } // make a best effort to delete the file. Don't report exceptions. try { File f = new File(this.id.getPath()); if (f.exists()) { f.delete(); } } catch (Throwable t) {} }
@Override public void closeAndDelete() throws IOException { try { close(); } finally { deleteChannel(); } }
@Override public void deleteChannel() { if (!isClosed() || this.fileChannel.isOpen()) { throw new IllegalStateException("Cannot delete a channel that is open."); } // make a best effort to delete the file. Don't report exceptions. try { File f = new File(this.id.getPath()); if (f.exists()) { f.delete(); } } catch (Throwable t) {} }
@Override public void closeAndDelete() throws IOException { try { close(); } finally { deleteChannel(); } }