org.apache.hadoop.fs.permission.ChmodParser Java Examples

The following examples show how to use org.apache.hadoop.fs.permission.ChmodParser. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FsShellPermissions.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@Override
protected void processOptions(LinkedList<String> args) throws IOException {
  CommandFormat cf = new CommandFormat(2, Integer.MAX_VALUE, "R", null);
  cf.parse(args);
  setRecursive(cf.getOpt("R"));

  String modeStr = args.removeFirst();
  try {
    pp = new ChmodParser(modeStr);
  } catch (IllegalArgumentException iea) {
    // TODO: remove "chmod : " so it's not doubled up in output, but it's
    // here for backwards compatibility...
    throw new IllegalArgumentException(
        "chmod : mode '" + modeStr + "' does not match the expected pattern.");      
  }
}
 
Example #2
Source File: FsShellPermissions.java    From big-c with Apache License 2.0 6 votes vote down vote up
@Override
protected void processOptions(LinkedList<String> args) throws IOException {
  CommandFormat cf = new CommandFormat(2, Integer.MAX_VALUE, "R", null);
  cf.parse(args);
  setRecursive(cf.getOpt("R"));

  String modeStr = args.removeFirst();
  try {
    pp = new ChmodParser(modeStr);
  } catch (IllegalArgumentException iea) {
    // TODO: remove "chmod : " so it's not doubled up in output, but it's
    // here for backwards compatibility...
    throw new IllegalArgumentException(
        "chmod : mode '" + modeStr + "' does not match the expected pattern.");      
  }
}
 
Example #3
Source File: FsShellPermissions.java    From RDFS with Apache License 2.0 5 votes vote down vote up
ChmodHandler(FileSystem fs, String modeStr) throws IOException {
  super("chmod", fs);
  try {
    pp = new ChmodParser(modeStr);
  } catch(IllegalArgumentException iea) {
    patternError(iea.getMessage());
  }
}