@Override
	public ParseResult beforeInvocation(ParseResult invocationContext) {
		ParseResult result = super.beforeInvocation(invocationContext);
		String defaultNameKey = (String) ReflectionUtils.getField(
				ReflectionUtils.findField(FileSystem.class, "FS_DEFAULT_NAME_KEY"), null);
		String fs = getHadoopConfiguration().get(defaultNameKey);
		if (fs != null && fs.length() > 0) {
			return result;
		}
		else {
			LOG.error("You must set namenode URL before running fs commands. Use `hadoop config fs` to configure namenode URL.");
			throw new IllegalStateException("You must set fs URL before running fs commands");
		}
	}
HDFS shell commands

@author Jarred Li
@author Glenn Renfro
spring-xd-shell/src/main/java/org/springframework/xd/shell/hadoop/FsShellCommands.java