Collection<VirtualFile> (@NotNull Collection<? extends VirtualFile> files) { if (isAllAccessAllowed()) return Collections.emptyList(); List<VirtualFile> deniedFiles = new ArrayList<>(); for (VirtualFile o : files) { if (!isWriteAccessAllowed(o, myProject)) { deniedFiles.add(o); } } if (deniedFiles.isEmpty()) { return Collections.emptyList(); } UnlockOption unlockOption = askToUnlock(deniedFiles); if (unlockOption == null) return deniedFiles; switch (unlockOption) { case UNLOCK -> allowWriting(deniedFiles); case UNLOCK_DIR -> allowWriting(ContainerUtil.map(deniedFiles, VirtualFile::getParent)); case UNLOCK_ALL -> ACCESS_ALLOWED.getValue(getApp()).incrementAndGet(); } return Collections.emptyList(); }