if (success && inheritPerms) {
//use FsShell to change group and permissions recursively
try {
FsShell fshell = new FsShell();
fshell.setConf(conf);
fshell.run(new String[]{"-chgrp", "-R", group, destf.toString()});
fshell.run(new String[]{"-chmod", "-R", permission, destf.toString()});
} catch (Exception e) {
throw new HiveException("Unable to set permissions of " + destf, e);
}
}