public void setPermissionsFromMaskString ( String mask ) { if ( mask . length ( ) != 4 ) { throw new IllegalArgumentException ( "Mask length must be 4" ) ; } try { setPermissions ( new UnsignedInteger32 ( String . valueOf ( Integer . parseInt ( mask , 8 ) ) ) ) ; } catch ( NumberFormatException nfe ) { throw new IllegalArgumentException ( "Mask must be 4 digit octal number." ) ; } }
Set permissions given a UNIX style mask for example 0644