Package ai.platon.pulsar.common.code
Object ProjectUtils
-
- All Implemented Interfaces:
public class ProjectUtilsA utility class for project-related operations, such as locating the project root directory or finding specific files within the project structure.
-
-
Field Summary
Fields Modifier and Type Field Description public final static ProjectUtilsINSTANCE
-
Method Summary
Modifier and Type Method Description final PathfindProjectRootDir()Finds the project root directory by searching for a file named VERSIONin the current directory and its parent directories.final PathfindProjectRootDir(Path startDir)Finds the project root directory by searching for a file named VERSIONstarting from the specified directory and traversing up its parent directories.final PathwalkToFindFile(String fileName, Path baseDir)Walks through the directory tree starting from the specified base directory to find a file with the given name. final PathfindFile(String fileName)Finds the project root directory and then searches for a file with the specified name within the project structure. -
-
Method Detail
-
findProjectRootDir
final Path findProjectRootDir()
Finds the project root directory by searching for a file named
VERSIONin the current directory and its parent directories.- Returns:
The project root directory if found, otherwise null.
-
findProjectRootDir
final Path findProjectRootDir(Path startDir)
Finds the project root directory by searching for a file named
VERSIONstarting from the specified directory and traversing up its parent directories.- Parameters:
startDir- The directory to start the search from.- Returns:
The project root directory if found, otherwise null.
-
walkToFindFile
final Path walkToFindFile(String fileName, Path baseDir)
Walks through the directory tree starting from the specified base directory to find a file with the given name.
- Parameters:
fileName- The name of the file to find.baseDir- The directory to start the search from.- Returns:
The path to the file if found, otherwise null.
-
-
-
-