@Override
 public void download(String key, File file) throws IOException {
   S3Object s3Object;
   try {
     s3Object = s3Client.getObject(Namespaces.get().getBucket(), key);
   } catch (AmazonClientException ace) {
     throw new IOException(ace);
   }
   file.delete();
   InputStream in = s3Object.getObjectContent();
   try {
     IOUtils.copyStreamToFile(in, file);
   } finally {
     in.close();
   }
 }
Пример #2
0
 @After
 public void tearDown() throws Exception {
   IOUtils.deleteRecursively(testTempDir);
 }