/** * Begin parsing permission stored in modeStr * * @param modeStr Permission mode, either octal or symbolic * @param symbolic Use-case specific symbolic pattern to match against * @throws IllegalArgumentException if unable to parse modeStr */ public PermissionParser(String modeStr, Pattern symbolic, Pattern octal) throws IllegalArgumentException { Matcher matcher = null; if ((matcher = symbolic.matcher(modeStr)).find()) { applyNormalPattern(modeStr, matcher); } else if ((matcher = octal.matcher(modeStr)).matches()) { applyOctalPattern(matcher); } else { throw new IllegalArgumentException(modeStr); } }
protected int combineModes(int existing, boolean exeOk) { return combineModeSegments(stickyBitType, stickyMode, (existing>>>9), false) << 9 | combineModeSegments(userType, userMode, (existing>>>6)&7, exeOk) << 6 | combineModeSegments(groupType, groupMode, (existing>>>3)&7, exeOk) << 3 | combineModeSegments(othersType, othersMode, existing&7, exeOk); }
/** * Begin parsing permission stored in modeStr * * @param modeStr Permission mode, either octal or symbolic * @param symbolic Use-case specific symbolic pattern to match against * @throws IllegalArgumentException if unable to parse modeStr */ public PermissionParser(String modeStr, Pattern symbolic, Pattern octal) throws IllegalArgumentException { Matcher matcher = null; if ((matcher = symbolic.matcher(modeStr)).find()) { applyNormalPattern(modeStr, matcher); } else if ((matcher = octal.matcher(modeStr)).matches()) { applyOctalPattern(modeStr, matcher); } else { throw new IllegalArgumentException(modeStr); } }
protected int combineModes(int existing, boolean exeOk) { return combineModeSegments(stickyBitType, stickyMode, (existing>>>9), false) << 9 | combineModeSegments(userType, userMode, (existing>>>6)&7, exeOk) << 6 | combineModeSegments(groupType, groupMode, (existing>>>3)&7, exeOk) << 3 | combineModeSegments(othersType, othersMode, existing&7, exeOk); }
/** * Begin parsing permission stored in modeStr * * @param modeStr Permission mode, either octal or symbolic * @param symbolic Use-case specific symbolic pattern to match against * @throws IllegalArgumentException if unable to parse modeStr */ public PermissionParser(String modeStr, Pattern symbolic, Pattern octal) throws IllegalArgumentException { Matcher matcher = null; if ((matcher = symbolic.matcher(modeStr)).find()) { applyNormalPattern(modeStr, matcher); } else if ((matcher = octal.matcher(modeStr)).matches()) { applyOctalPattern(modeStr, matcher); } else { throw new IllegalArgumentException(modeStr); } }
protected int combineModes(int existing, boolean exeOk) { return combineModeSegments(userType, userMode, (existing>>>6)&7, exeOk) << 6 | combineModeSegments(groupType, groupMode, (existing>>>3)&7, exeOk) << 3 | combineModeSegments(othersType, othersMode, existing&7, exeOk); }
/** * Begin parsing permission stored in modeStr * * @param modeStr Permission mode, either octal or symbolic * @param symbolic Use-case specific symbolic pattern to match against * @throws IllegalArgumentException if unable to parse modeStr */ public PermissionParser(String modeStr, Pattern symbolic, Pattern octal) throws IllegalArgumentException { Matcher matcher = null; if ((matcher = symbolic.matcher(modeStr)).find()) { applyNormalPattern(modeStr, matcher); } else if ((matcher = octal.matcher(modeStr)).matches()) { applyOctalPattern(modeStr, matcher); } else { throw new IllegalArgumentException(modeStr); } }
protected int combineModes(int existing, boolean exeOk) { return combineModeSegments(stickyBitType, stickyMode, (existing>>>9), false) << 9 | combineModeSegments(userType, userMode, (existing>>>6)&7, exeOk) << 6 | combineModeSegments(groupType, groupMode, (existing>>>3)&7, exeOk) << 3 | combineModeSegments(othersType, othersMode, existing&7, exeOk); }
/** * Begin parsing permission stored in modeStr * * @param modeStr Permission mode, either octal or symbolic * @param symbolic Use-case specific symbolic pattern to match against * @throws IllegalArgumentException if unable to parse modeStr */ public PermissionParser(String modeStr, Pattern symbolic, Pattern octal) throws IllegalArgumentException { Matcher matcher = null; if ((matcher = symbolic.matcher(modeStr)).find()) { applyNormalPattern(modeStr, matcher); } else if ((matcher = octal.matcher(modeStr)).matches()) { applyOctalPattern(modeStr, matcher); } else { throw new IllegalArgumentException(modeStr); } }
protected int combineModes(int existing, boolean exeOk) { return combineModeSegments(stickyBitType, stickyMode, (existing>>>9), false) << 9 | combineModeSegments(userType, userMode, (existing>>>6)&7, exeOk) << 6 | combineModeSegments(groupType, groupMode, (existing>>>3)&7, exeOk) << 3 | combineModeSegments(othersType, othersMode, existing&7, exeOk); }
/** * Begin parsing permission stored in modeStr * * @param modeStr Permission mode, either octal or symbolic * @param symbolic Use-case specific symbolic pattern to match against * @throws IllegalArgumentException if unable to parse modeStr */ public PermissionParser(String modeStr, Pattern symbolic, Pattern octal) throws IllegalArgumentException { Matcher matcher = null; if ((matcher = symbolic.matcher(modeStr)).find()) { applyNormalPattern(modeStr, matcher); } else if ((matcher = octal.matcher(modeStr)).matches()) { applyOctalPattern(modeStr, matcher); } else { throw new IllegalArgumentException(modeStr); } }
protected int combineModes(int existing, boolean exeOk) { return combineModeSegments(stickyBitType, stickyMode, (existing>>>9), false) << 9 | combineModeSegments(userType, userMode, (existing>>>6)&7, exeOk) << 6 | combineModeSegments(groupType, groupMode, (existing>>>3)&7, exeOk) << 3 | combineModeSegments(othersType, othersMode, existing&7, exeOk); }