VirtualFile dir = LocalFileSystem.getInstance().findFileByPath("/some/directory"); if (dir != null && dir.isDirectory()) { System.out.println("This is a directory"); }
VirtualFile[] files = projectBaseDir.getChildren(); for (VirtualFile file : files) { if (file.isDirectory()) { System.out.println("Directory: " + file.getName()); } }The package library for the com.intellij.openapi.vfs package is part of the IntelliJ IDEA platform.