private void processPreviewFile(@NotNull final String fileName) {
        Logger.getLogger("test").fine("preview " + fileName);

        if (previewFileWorker != null)
            previewFileWorker.cancel(true);

        previewFileWorker = new SwingWorker<JComponent, Void>() {
            @Override
            protected JComponent doInBackground() throws Exception {
                FileInfo f = fsReader.getFileByPath(fileName);

                if (!f.getAttributes().contains(FileInfo.FileAttribute.IS_REGULAR_FILE)) {
                    return PreviewComponentFactory.INSTANCE.getComponentForDir(f);
                }

                InputStream is = fsReader.retrieveFileInputStream(fileName);

                return PreviewComponentFactory.INSTANCE.getComponentForFile(f, is, PREVIEW_MAX_SIZE);
            }

            @Override
            public void done() {
                boolean cancelled = false;

                JComponent internal = null;
                try {
                    JComponent result = get();
                    if (result == null) {
                        internal = PreviewComponentFactory.INSTANCE.getComponentForFailure();
                    } else {
                        internal = result;
                    }


                } catch (InterruptedException | CancellationException e) {
                    cancelled = true;
                } catch (ExecutionException e) {
                    Logger.getLogger("test").warning("Exception: " + e.getCause().getMessage());
                    internal = PreviewComponentFactory.INSTANCE.getComponentForFailure();
                } finally {
                    if (!cancelled && internal != null) {
                        previewFrame.setPreviewer(internal);
                        previewFrame.show(self);
                    }
                }
            }
        };

        previewFrame.setPreviewer(PreviewComponentFactory.INSTANCE.getComponentForLoading());
        previewFrame.show(self);

        previewFileWorker.execute();
    }