Source:
<code>public String deploy(BaseArtifactType artifact, Target target, SrampAtomApiClient client) throws Exception { InputStream is = null; OutputStream os = null; try { is = client.getArtifactContent(ArtifactType.valueOf(artifact), artifact.getUuid()); String deployDirProperty = target.getProperty(CUSTOM_DEPLOY_DIR_PROPERTY); File deployDir = new File(deployDirProperty); if (!deployDir.exists()) { <START> logger.info(Messages.i18n.format("DeploymentResource.CreatingDeployDir", deployDir)); END> deployDir.mkdirs(); } String deploymentName = artifact.getName(); String mavenId = SrampModelUtils.getCustomProperty(artifact, "maven.artifactId"); String version = SrampModelUtils.getCustomProperty(artifact, "maven.version"); String classifier = SrampModelUtils.getCustomProperty(artifact, "maven.classifier"); String type = SrampModelUtils.getCustomProperty(artifact, "maven.type"); if (mavenId != null) { StringBuilder nameBuilder = new StringBuilder(); nameBuilder.append(mavenId); nameBuilder.append("-"); nameBuilder.append(version); if (classifier != null) { nameBuilder.append("-"); nameBuilder.append(classifier); } nameBuilder.append("."); nameBuilder.append(type); deploymentName = nameBuilder.toString(); } File file = new File(deployDir + "/" + deploymentName); if (file.exists()) file.delete(); file.createNewFile(); os = new FileOutputStream(file); IOUtils.copy(is, os); Map<String, String> props = new HashMap<String, String>(); props.put("deploy.copy.file", file.getCanonicalPath()); recordUndeploymentInfo(artifact, target, props, client); logger.info(Messages.i18n.format("CopyFileDeployer.deploymentSuccessfully", artifact.getUuid())); return file.getAbsolutePath(); } finally { IOUtils.closeQuietly(os); IOUtils.closeQuietly(is); } }</code><technical_language>this self-contained _not_ i18n strings in demo. else need define a Messages messages.properties this custom JAR. pull i18n messages core dtgov JARs here</technical_language>

Target:
public String deploy(BaseArtifactType artifact, Target target, SrampAtomApiClient client) throws Exception { InputStream is = null; OutputStream os = null; try { is = client.getArtifactContent(ArtifactType.valueOf(artifact), artifact.getUuid()); String deployDirProperty = target.getProperty(CUSTOM_DEPLOY_DIR_PROPERTY); File deployDir = new File(deployDirProperty); if (!deployDir.exists()) { logger.info("Creating Directory for deployment:"+ deployDir); deployDir.mkdirs(); } String deploymentName = artifact.getName(); String mavenId = SrampModelUtils.getCustomProperty(artifact, "maven.artifactId"); String version = SrampModelUtils.getCustomProperty(artifact, "maven.version"); String classifier = SrampModelUtils.getCustomProperty(artifact, "maven.classifier"); String type = SrampModelUtils.getCustomProperty(artifact, "maven.type"); if (mavenId != null) { StringBuilder nameBuilder = new StringBuilder(); nameBuilder.append(mavenId); nameBuilder.append("-"); nameBuilder.append(version); if (classifier != null) { nameBuilder.append("-"); nameBuilder.append(classifier); } nameBuilder.append("."); nameBuilder.append(type); deploymentName = nameBuilder.toString(); } File file = new File(deployDir + "/" + deploymentName); if (file.exists()) file.delete(); file.createNewFile(); os = new FileOutputStream(file); IOUtils.copy(is, os); Map<String, String> props = new HashMap<String, String>(); props.put("deploy.copy.file", file.getCanonicalPath()); recordUndeploymentInfo(artifact, target, props, client); logger.info("The deployment of the artifact with UUID=" + artifact.getUuid() + " has been successfully done."); return file.getAbsolutePath(); } finally { IOUtils.closeQuietly(os); IOUtils.closeQuietly(is); } }