VirtualFile currentFile = // current file VirtualFile childFile = currentFile.findFileByRelativePath("path/to/child/file");
Project project = // current project VirtualFile projectDir = project.getBaseDir(); VirtualFile childFile = projectDir.findFileByRelativePath("path/to/child/file");
ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); URL url = classLoader.getResource("path/to/file"); if (url != null) { String fileUrl = url.getFile(); VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(fileUrl); }The com.intellij.openapi.vfs package is a part of the IntelliJ IDEA software development kit (SDK), which is a Java library that provides APIs for developing plugins and extensions for IntelliJ IDEA.