public static Stream loadStream(CuratorFramework client, String streamName,
			StreamFactory streamFactory) throws Exception {
		try {
			byte[] definition = client.getData().forPath(Paths.build(Paths.STREAMS, streamName));
			Map<String, String> definitionMap = ZooKeeperUtils.bytesToMap(definition);

			byte[] deploymentPropertiesData = client.getData().forPath(
					Paths.build(Paths.STREAM_DEPLOYMENTS, streamName));
			if (deploymentPropertiesData != null && deploymentPropertiesData.length > 0) {
				definitionMap.put("deploymentProperties", new String(deploymentPropertiesData, "UTF-8"));
			}
			return streamFactory.createStream(streamName, definitionMap);
		}
		catch (KeeperException.NoNodeException e) {
			// stream is not deployed or does not exist
		}
		return null;
	}
Load the {@link org.springframework.xd.dirt.core.Stream} instance
for a given stream name <i>if the stream is deployed</i>. It will
include the stream definition as well as any deployment properties
data for the stream deployment.

@param client         curator client
@param streamName     the name of the stream to load
@param streamFactory  stream factory used to create instance of stream
@return the stream instance, or {@code null} if the stream does
        not exist or is not deployed
@throws Exception if ZooKeeper access fails for any reason
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/server/admin/deployment/zk/DeploymentLoader.java