public static FsPermission valueOf ( String unixSymbolicPermission ) { if ( unixSymbolicPermission == null ) { return null ; } else if ( unixSymbolicPermission . length ( ) != 10 ) { throw new IllegalArgumentException ( "length != 10(unixSymbolicPermission=" + unixSymbolicPermission + ")" ) ; } int n = 0 ; for ( int i = 1 ; i < unixSymbolicPermission . length ( ) ; i ++ ) { n = n << 1 ; char c = unixSymbolicPermission . charAt ( i ) ; n += ( c == ' ' || c == ' ' || c == ' ' ) ? 0 : 1 ; } return new FsPermission ( ( short ) n ) ; }
Create a FsPermission from a Unix symbolic permission string