Class OsSpecificUtil

java.lang.Object
com.puppycrawl.tools.checkstyle.utils.OsSpecificUtil

public final class OsSpecificUtil extends Object
Class which provides OS related utilities.
  • Constructor Details

    • OsSpecificUtil

      private OsSpecificUtil()
      Hiding public and default constructor.
  • Method Details

    • updateDirectory

      public static void updateDirectory(Path directory) throws IOException
      Updates the specified directory by resolving symbolic links, ensuring it exists, and creating any necessary parent directories. If the provided path is a symbolic link, it resolves it to the actual directory, throwing an IOException if the resolved path is not a directory. Creates directories if they do not exist.
      Parameters:
      directory - The path to the directory to be updated.
      Throws:
      IOException - If an I/O error occurs or if the resolved symbolic link is not a directory.