Search in sources :

Example 21 with FileTypeManager

use of com.intellij.openapi.fileTypes.FileTypeManager in project intellij-community by JetBrains.

the class CommonRefactoringUtil method collectReadOnlyFiles.

public static void collectReadOnlyFiles(@NotNull VirtualFile vFile, @NotNull final Collection<VirtualFile> list) {
    final FileTypeManager fileTypeManager = FileTypeManager.getInstance();
    VfsUtilCore.visitChildrenRecursively(vFile, new VirtualFileVisitor(VirtualFileVisitor.NO_FOLLOW_SYMLINKS) {

        @Override
        public boolean visitFile(@NotNull VirtualFile file) {
            final boolean ignored = fileTypeManager.isFileIgnored(file);
            if (!file.isWritable() && !ignored) {
                list.add(file);
            }
            return !ignored;
        }
    });
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) FileTypeManager(com.intellij.openapi.fileTypes.FileTypeManager) VirtualFileVisitor(com.intellij.openapi.vfs.VirtualFileVisitor)

Aggregations

FileTypeManager (com.intellij.openapi.fileTypes.FileTypeManager)21 VirtualFile (com.intellij.openapi.vfs.VirtualFile)9 VirtualFileVisitor (com.intellij.openapi.vfs.VirtualFileVisitor)5 NotNull (org.jetbrains.annotations.NotNull)5 FileType (com.intellij.openapi.fileTypes.FileType)4 Result (com.intellij.openapi.application.Result)3 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)3 IOException (java.io.IOException)3 Nullable (org.jetbrains.annotations.Nullable)3 WriteCommandAction (com.intellij.openapi.command.WriteCommandAction)2 Project (com.intellij.openapi.project.Project)2 VfsUtilCore (com.intellij.openapi.vfs.VfsUtilCore)2 NewVirtualFile (com.intellij.openapi.vfs.newvfs.NewVirtualFile)2 PsiFile (com.intellij.psi.PsiFile)2 MockDisposable (com.facebook.buck.intellij.ideabuck.test.util.MockDisposable)1 HashMultiset (com.google.common.collect.HashMultiset)1 Multiset (com.google.common.collect.Multiset)1 FindBundle (com.intellij.find.FindBundle)1 FindModel (com.intellij.find.FindModel)1 FindInProjectManager (com.intellij.find.findInProject.FindInProjectManager)1