public void reset() { synchronized (lock) { if (current_context != null) { current_context.destroy(new Exception("Reset")); } save_to.delete(); } }
public DiskManagerChannel createChannel() throws DownloadException { try { synchronized (lock) { if (current_context == null) { current_context = new context(); } return (current_context.createChannel()); } } catch (Throwable e) { throw (new DownloadException("Channel creation failed", e)); } }