What I want to do is to construct an array of strings that will contain a path to the file, for each file in a given project. I have the instance of Project class.
One way that I have found how to do that is to use `Project.getBaseDir` to get the root directory of the project and then use `VfsUtilCore.visitChildrenRecursively` to traverse through all files and retrieve the path for them using `VirtualFile.getPath`.
However, `Project.getBaseDir` is deprecated.
The docs read:
use other methods depending on what you actually need:
if you need to find a root directory for a file use getContentRootForFile;
if you have a Module instance in the context, use one of its content roots;
if you just need to get a directory somewhere near project files, use guessProjectDir;
if you really need to locate .idea directory or .ipr file, use IProjectStore.
What I actually need is to get the VirutalFile that represents the root directory of the repository so that I can traverse that with visitChildrenRecursively. None of the described replacements for getBaseDir seem to fit my use case.
What is the best way to get the paths to all files in the project?