OperationStatus (@NotNull Collection<? extends VirtualFile> originalFiles, @NotNull Collection<? extends VirtualFile> files) { List<VirtualFile> readOnlyFiles = new ArrayList<>(); for (VirtualFile file : files) { if (file.exists()) { if (!file.isWritable()) { readOnlyFiles.add(file); } } } // we shouldn't report success if files for which write operation is requested are still non-writable assert !readOnlyFiles.isEmpty() || ContainerUtil.and(originalFiles, file -> file == null || file.isWritable()) : "Original files: " + originalFiles + ", files: " + files; return new OperationStatusImpl(VfsUtilCore.toVirtualFileArray(readOnlyFiles)); }