/** This method is used to interrupt file loading thread. */ public void invalidateFileCache() { if (filesLoader != null) { filesLoader.loadThread.interrupt(); filesLoader.cancelRunnables(); filesLoader = null; } }
/** Validates content of file cache. */ public void validateFileCache() { File currentDirectory = filechooser.getCurrentDirectory(); if (currentDirectory == null) { return; } if (filesLoader != null) { filesLoader.loadThread.interrupt(); filesLoader.cancelRunnables(); } setBusy(true, ++fetchID); filesLoader = new FilesLoader(currentDirectory, fetchID); }