Source:
public void testRecoverWriteJob() throws SignatureException, IOException, XmlProcessingException, JobRecoveryException, URISyntaxException { final String bucketName = "test_recover_write_job_bucket"; final String book1 = "beowulf.txt"; final String book2 = "ulysses.txt"; final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); try { client.putBucket(new PutBucketRequest(bucketName)); helpers.ensureBucketExists(bucketName); final Path objFile1 = ResourceUtils.loadFileResource(Util.RESOURCE_BASE_NAME + book1); final Path objFile2 = ResourceUtils.loadFileResource(Util.RESOURCE_BASE_NAME + book2); final Ds3Object obj1 = new Ds3Object(book1, Files.size(objFile1)); final Ds3Object obj2 = new Ds3Object(book2, Files.size(objFile2)); final Ds3ClientHelpers.Job job = Ds3ClientHelpers.wrap(client).startWriteJob(bucketName, Lists.newArrayList(obj1, obj2)); final PutObjectResponse putResponse1 = client.putObject(new PutObjectRequest( job.getBucketName(), book1, job.getJobId(), Files.size(objFile1), 0, new ResourceObjectPutter(Util.RESOURCE_BASE_NAME).buildChannel(book1) )); assertThat(putResponse1, is(notNullValue())); assertThat(putResponse1.getStatusCode(), is(equalTo(200))); final Ds3ClientHelpers.Job recoverJob = Ds3ClientHelpers.wrap(client).recoverWriteJob(job.getJobId()); final PutObjectResponse putResponse2 = client.putObject(new PutObjectRequest( recoverJob.getBucketName(), book2, recoverJob.getJobId(), Files.size(objFile2), 0, new ResourceObjectPutter(Util.RESOURCE_BASE_NAME).buildChannel(book2) )); assertThat(putResponse2, is(notNullValue())); assertThat(putResponse2.getStatusCode(), is(equalTo(200))); } finally { Util.deleteAllContents(client, bucketName); } }

Target:
public void testRecoverWriteJob() throws SignatureException, IOException, XmlProcessingException, JobRecoveryException, URISyntaxException { final String bucketName = "test_recover_write_job_bucket"; final String book1 = "beowulf.txt"; final String book2 = "ulysses.txt"; final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); try { client.putBucket(new PutBucketRequest(bucketName)); helpers.ensureBucketExists(bucketName); final Path objPath1 = ResourceUtils.loadFileResource(Util.RESOURCE_BASE_NAME + book1); final Path objPath2 = ResourceUtils.loadFileResource(Util.RESOURCE_BASE_NAME + book2); final Ds3Object obj1 = new Ds3Object(book1, Files.size(objPath1)); final Ds3Object obj2 = new Ds3Object(book2, Files.size(objPath2)); final Ds3ClientHelpers.Job job = Ds3ClientHelpers.wrap(client).startWriteJob(bucketName, Lists.newArrayList(obj1, obj2)); final PutObjectResponse putResponse1 = client.putObject(new PutObjectRequest( job.getBucketName(), book1, job.getJobId(), Files.size(objPath1), 0, new ResourceObjectPutter(Util.RESOURCE_BASE_NAME).buildChannel(book1) )); assertThat(putResponse1, is(notNullValue())); assertThat(putResponse1.getStatusCode(), is(equalTo(200))); final Ds3ClientHelpers.Job recoverJob = Ds3ClientHelpers.wrap(client).recoverWriteJob(job.getJobId()); final PutObjectResponse putResponse2 = client.putObject(new PutObjectRequest( recoverJob.getBucketName(), book2, recoverJob.getJobId(), Files.size(objPath2), 0, new ResourceObjectPutter(Util.RESOURCE_BASE_NAME).buildChannel(book2) )); assertThat(putResponse2, is(notNullValue())); assertThat(putResponse2.getStatusCode(), is(equalTo(200))); } finally { Util.deleteAllContents(client, bucketName); } }