Object ProjectUtils

  • All Implemented Interfaces:

    
    public class ProjectUtils
    
                        

    A utility class for project-related operations, such as locating the project root directory or finding specific files within the project structure.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Path findProjectRootDir() Finds the project root directory by searching for a file named VERSION in the current directory and its parent directories.
      final Path findProjectRootDir(Path startDir) Finds the project root directory by searching for a file named VERSION starting from the specified directory and traversing up its parent directories.
      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.
      final Path findFile(String fileName) Finds the project root directory and then searches for a file with the specified name within the project structure.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • findProjectRootDir

         final Path findProjectRootDir()

        Finds the project root directory by searching for a file named VERSION in 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 VERSION starting 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.

      • findFile

         final Path findFile(String fileName)

        Finds the project root directory and then searches for a file with the specified name within the project structure.

        Parameters:
        fileName - The name of the file to find.
        Returns:

        The path to the file if found, otherwise null.