static void changePermissions(String cmd, String argv[], int startIndex, FsShell shell) throws IOException { CmdHandler handler = null; boolean recursive = false; // handle common arguments, currently only "-R" for (; startIndex < argv.length && argv[startIndex].equals("-R"); startIndex++) { recursive = true; } if ( startIndex >= argv.length ) { throw new IOException("Not enough arguments for the command"); } if (cmd.equals("-chmod")) { handler = new ChmodHandler(argv[startIndex++]); } else if (cmd.equals("-chown")) { handler = new ChownHandler(argv[startIndex++]); } else if (cmd.equals("-chgrp")) { handler = new ChgrpHandler(argv[startIndex++]); } shell.runCmdHandler(handler, argv, startIndex, recursive); }
static int changePermissions(FileSystem fs, String cmd, String argv[], int startIndex, FsShell shell) throws IOException { CmdHandler handler = null; boolean recursive = false; // handle common arguments, currently only "-R" for (; startIndex < argv.length && argv[startIndex].equals("-R"); startIndex++) { recursive = true; } if ( startIndex >= argv.length ) { throw new IOException("Not enough arguments for the command"); } if (cmd.equals("-chmod")) { handler = new ChmodHandler(fs, argv[startIndex++]); } else if (cmd.equals("-chown")) { handler = new ChownHandler(fs, argv[startIndex++]); } else if (cmd.equals("-chgrp")) { handler = new ChgrpHandler(fs, argv[startIndex++]); } return shell.runCmdHandler(handler, argv, startIndex, recursive); }
static void changePermissions(FileSystem fs, String cmd, String argv[], int startIndex, FsShell shell) throws IOException { CmdHandler handler = null; boolean recursive = false; // handle common arguments, currently only "-R" for (; startIndex < argv.length && argv[startIndex].equals("-R"); startIndex++) { recursive = true; } if ( startIndex >= argv.length ) { throw new IOException("Not enough arguments for the command"); } if (cmd.equals("-chmod")) { handler = new ChmodHandler(fs, argv[startIndex++]); } else if (cmd.equals("-chown")) { handler = new ChownHandler(fs, argv[startIndex++]); } else if (cmd.equals("-chgrp")) { handler = new ChgrpHandler(fs, argv[startIndex++]); } shell.runCmdHandler(handler, argv, startIndex, recursive); }