public void execute(ExecutionContext executionContext) throws CommandExecutionException {
Environment environment = executionContext.getEnvironment();
List<String> parameters = executionContext.getParameters();
FileValue pwd = environment.pwd();
if (parameters.isEmpty()) {
environment.cd();
} else {
String newFolder = parameters.get(0);
FileValue newPwd = pwd.child(newFolder);
File newFolderFile = newPwd.getAsFile();
if (! newFolderFile.exists()) {
throw new CommandExecutionException("No such directory: " + newFolderFile);
}
if (! newFolderFile.isDirectory()) {
throw new CommandExecutionException(newFolderFile + "is not a directory");