void () { synchronized (myLock) { myCancelled.set(true); if (myPrevLocalFile != null) { myLocalVirtualFile = myPrevLocalFile; myLocalFile = VfsUtilCore.virtualToIoFile(myLocalVirtualFile); myState = RemoteFileState.DOWNLOADED; myErrorMessage = null; } else { myState = RemoteFileState.ERROR_OCCURRED; } } for (FileDownloadingListener listener : myListeners) { listener.downloadingCancelled(); } }