Class UserOnlyDirectory

java.lang.Object
nl.pim16aap2.lightkeeper.runtime.UserOnlyDirectory

public final class UserOnlyDirectory extends Object
Creates and validates directories that must only be accessible to the current operating-system user.
  • Method Details

    • prepare

      public static void prepare(Path directory) throws IOException
      Creates a directory with 0700 permissions and verifies its owner and permissions on POSIX file systems. Non-POSIX file systems receive normal directory creation because they do not expose equivalent attributes.
      Parameters:
      directory - Directory to create or validate.
      Throws:
      IOException - When the directory or its attributes cannot be accessed.
      IllegalStateException - When an existing POSIX path is not a user-only directory owned by the current user.