private static void chmod(final Wagon wagon, final Repository repository,
final String chmodOptions, final String chmodMode)
throws MojoExecutionException {
try {
if (wagon instanceof CommandExecutor) {
CommandExecutor exec = (CommandExecutor) wagon;
exec.executeCommand("chmod " + chmodOptions + " " + chmodMode + " " + repository.getBasedir());
}
// else ? silently ignore, FileWagon is not a CommandExecutor!
} catch (CommandExecutionException e) {
throw new MojoExecutionException("Error uploading site", e);
}