code: private void changeDirectoryPermissions(String dir, String mode, 
                                                boolean isRecursive) {
      int ret = 0;
      try {
        ret = FileUtil.chmod(dir, mode, isRecursive);
      } catch (Exception e) {
        LOG.warn("Exception in changing permissions for directory " + dir + 
                    ". Exception: " + e.getMessage());
      }
      if (ret != 0) {
        LOG.warn("Could not change permissions for directory " + dir);
      }
    }
docs: convenience method to execute chmod.