private void copyFilesToTarget(URI baseUri, List<File> files, String host) {
		for (File file : files) {
			URI targetUri;
			try {
				targetUri = new URI(baseUri.getRawPath() + "/" + file.getName());
			}
			catch (URISyntaxException e1) {
				throw new IllegalStateException(baseUri.getRawPath() + "/" + file.getName() + " is not a valid URI", e1);
			}
			if (xdEnvironment.isOnEc2()) {
				StreamUtils.copyFileToRemote(xdEnvironment.getPrivateKey(), host, targetUri,
						file, WAIT_TIME);
			}
			else {
				try {
					FileCopyUtils.copy(file, new File(targetUri.getPath()));
				}
				catch (IOException e) {
					throw new IllegalStateException("copying job files to XD failed", e);
				}
			}
		}
	}
Copies files to the specified target on the local machine or to a remote machine via
ssh.
@param baseUri Target location
@param files The list of files to copy.
@param host the host (if on remote machine) to target the file copy.
spring-xd-integration-test/src/test/java/org/springframework/xd/integration/test/AbstractIntegrationTest.java