Search in sources :

Example 1 with VirtualFileImpl

use of com.intellij.openapi.vfs.newvfs.impl.VirtualFileImpl in project scss-lint-plugin by idok.

the class FileUtils method getAllFilesInDirectory.

public static List<String> getAllFilesInDirectory(VirtualFile directory, String target, String replacement) {
    List<String> files = new ArrayList<String>();
    VirtualFile[] children = directory.getChildren();
    for (VirtualFile child : children) {
        if (child instanceof VirtualDirectoryImpl) {
            files.addAll(getAllFilesInDirectory(child, target, replacement));
        } else if (child instanceof VirtualFileImpl) {
            files.add(child.getPath().replace(target, replacement));
        }
    }
    return files;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) VirtualDirectoryImpl(com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl) ArrayList(java.util.ArrayList) VirtualFileImpl(com.intellij.openapi.vfs.newvfs.impl.VirtualFileImpl)

Example 2 with VirtualFileImpl

use of com.intellij.openapi.vfs.newvfs.impl.VirtualFileImpl in project WebStormRequireJsPlugin by Fedott.

the class FileUtils method getAllFilesInDirectory.

public static List<String> getAllFilesInDirectory(VirtualFile directory, String target, String replacement) {
    List<String> files = new ArrayList<String>();
    VirtualFile[] children = directory.getChildren();
    for (VirtualFile child : children) {
        if (child instanceof VirtualDirectoryImpl) {
            files.addAll(getAllFilesInDirectory(child, target, replacement));
        } else if (child instanceof VirtualFileImpl) {
            files.add(child.getPath().replace(target, replacement));
        }
    }
    return files;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) VirtualDirectoryImpl(com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl) ArrayList(java.util.ArrayList) VirtualFileImpl(com.intellij.openapi.vfs.newvfs.impl.VirtualFileImpl)

Aggregations

VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 VirtualDirectoryImpl (com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl)2 VirtualFileImpl (com.intellij.openapi.vfs.newvfs.impl.VirtualFileImpl)2 ArrayList (java.util.ArrayList)2