## org.apache.hadoop.fs.permission
Class ChmodParser

    java.lang.Object
      org.apache.hadoop.fs.permission.ChmodParser

    public class ChmodParser

extends Object

Parse a permission mode passed in from a chmod command and apply that mode against an existing file.

Field Summary
`protected short` `groupMode`
`protected char` `groupType`
`protected short` `othersMode`
`protected char` `othersType`
`protected boolean` `symbolic`
`protected short` `userMode`
`protected char` `userType`

Constructor Summary
`ChmodParser(String modeStr)`

Method Summary
`short` `applyNewPermission(FileStatus file)` Apply permission against specified file and determine what the new mode would be
`protected int` `combineModes(int existing, boolean exeOk)`
`protected int` `combineModeSegments(char type, int mode, int existing, boolean exeOk)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### symbolic

    protected boolean symbolic

### userMode

    protected short userMode

### groupMode

    protected short groupMode

### othersMode

    protected short othersMode

### userType

    protected char userType

### groupType

    protected char groupType

### othersType

    protected char othersType

Constructor Detail

### ChmodParser

    public ChmodParser(String modeStr)
                throws IllegalArgumentException

Throws:
  `IllegalArgumentException`

Method Detail

### applyNewPermission

    public short applyNewPermission(FileStatus file)

  Apply permission against specified file and determine what the new mode would be

  Parameters:
    `file` - File against which to apply mode
  Returns:
    File's new mode if applied.

### combineModes

    protected int combineModes(int existing,
                               boolean exeOk)

### combineModeSegments

    protected int combineModeSegments(char type,
                                      int mode,
                                      int existing,
                                      boolean exeOk)

Copyright © 2009 The Apache Software Foundation