Enum FilePermissionHelper.PosixFilePermission

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ALL_PERMS
      Full permissions for all users (chmod 777, stat -rwxrwxrwx).
      USER_ALL
      Full permissions for the user (chmod 700, stat -rwx------).
      USER_RO
      Read-only permission for the user (chmod 400, stat -r--------).
      USER_RW
      Read and write permission for the user (chmod 600, stat -rw-------).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String chmodForm  
      private java.lang.String statForm  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private PosixFilePermission​(java.lang.String chmodForm, java.lang.String statForm)
      Constructor for PosixFilePermission enum.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String chmodForm()
      Gets the chmod-style (numeric) representation of the permission.
      java.lang.String statForm()
      Gets the stat-style (symbolic) representation of the permission.
      static FilePermissionHelper.PosixFilePermission valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static FilePermissionHelper.PosixFilePermission[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • chmodForm

        private java.lang.String chmodForm
      • statForm

        private java.lang.String statForm
    • Constructor Detail

      • PosixFilePermission

        private PosixFilePermission​(java.lang.String chmodForm,
                                    java.lang.String statForm)
        Constructor for PosixFilePermission enum.
        Parameters:
        chmodForm - the chmod-style representation of the permission
        statForm - the stat-style representation of the permission
    • Method Detail

      • values

        public static FilePermissionHelper.PosixFilePermission[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (FilePermissionHelper.PosixFilePermission c : FilePermissionHelper.PosixFilePermission.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static FilePermissionHelper.PosixFilePermission valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • statForm

        public java.lang.String statForm()
        Gets the stat-style (symbolic) representation of the permission.
        Returns:
        the stat-formatted permission string (e.g., "-rw-------").
      • chmodForm

        public java.lang.String chmodForm()
        Gets the chmod-style (numeric) representation of the permission.
        Returns:
        the chmod-formatted permission string (e.g., "600").