Class FilePermissions

java.lang.Object
org.springframework.boot.buildpack.platform.io.FilePermissions

public final class FilePermissions extends Object
Utilities for dealing with file permissions and attributes.
Since:
2.5.0
Author:
Scott Frederick
  • Method Details

    • umaskForPath

      public static int umaskForPath(Path path) throws IOException
      Return the integer representation of the file permissions for a path, where the integer value conforms to the umask octal notation.
      Parameters:
      path - the file path
      Returns:
      the integer representation
      Throws:
      IOException - if path permissions cannot be read
    • posixPermissionsToUmask

      public static int posixPermissionsToUmask(Collection<PosixFilePermission> permissions)
      Return the integer representation of a set of Posix file permissions, where the integer value conforms to the umask octal notation.
      Parameters:
      permissions - the set of PosixFilePermissions
      Returns:
      the integer representation