public static ExtendedResource wrap(Resource original) {
		if (original instanceof FileSystemResource) {
			return new FileSystemExtendedResource((FileSystemResource) original);
		}
		else if (original.getClass().equals(HDFS_RESOURCE)) {
			return new HdfsExtendedResource(original);
		}
		else {
			throw new IllegalArgumentException("Unsupported resource " + original);
		}

	}
Makes sure that the resource and all its parent "directories" exist, creating them if necessary.
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/module/ExtendedResource.java