@Test(expected=AmazonServiceException.class) public void testPoll_fileNotFound() throws Exception { S3ConfigurationSource instance = new S3ConfigurationSource(client, "bucketname", "404.txt"); PollResult result = instance.poll(INITIAL, CHECK_POINT); assertNotNull(result); assertEquals("true",result.getComplete().get("loaded")); assertEquals(1,result.getComplete().size()); }
@Override public PollResult poll(boolean initial, Object checkPoint) throws IOException, AmazonServiceException { GetObjectRequest s3request = new GetObjectRequest(bucketName, key); InputStream is = null; try { S3Object result = client.getObject(s3request); is = result.getObjectContent(); Map<String,Object> resultMap = inputStreamToMap(is); return PollResult.createFull(resultMap); } finally { if (is!=null) is.close(); } }
S3ConfigurationSource implements PolledConfigurationSource { @Override public PollResult poll(boolean initial, Object checkPoint) throws IOException, AmazonServiceException { GetObjectRequest s3request = new GetObjectRequest(bucketName, key); InputStream is = null; try { S3Object result = client.getObject(s3request); is = result.getObjectContent(); Map<String,Object> resultMap = inputStreamToMap(is); return PollResult.createFull(resultMap); } finally { if (is!=null) is.close(); } } }
S3ConfigurationSource implements PolledConfigurationSource { @Override public PollResult poll(boolean initial, Object checkPoint) throws IOException, AmazonServiceException { GetObjectRequest s3request = new GetObjectRequest(bucketName, key); InputStream is = null; try { S3Object result = client.getObject(s3request); is = result.getObjectContent(); Map<String,Object> resultMap = inputStreamToMap(is); return PollResult.createFull(resultMap); } finally { if (is!=null) is.close(); } } S3ConfigurationSource(AWSCredentialsProvider credentialsProvider, String bucketName, String key);  S3ConfigurationSource(AmazonS3 client, String bucketName, String key); }
S3ConfigurationSource implements PolledConfigurationSource { @Override public PollResult poll(boolean initial, Object checkPoint) throws IOException, AmazonServiceException { GetObjectRequest s3request = new GetObjectRequest(bucketName, key); InputStream is = null; try { S3Object result = client.getObject(s3request); is = result.getObjectContent(); Map<String,Object> resultMap = inputStreamToMap(is); return PollResult.createFull(resultMap); } finally { if (is!=null) is.close(); } } S3ConfigurationSource(AWSCredentialsProvider credentialsProvider, String bucketName, String key);  S3ConfigurationSource(AmazonS3 client, String bucketName, String key); @Override PollResult poll(boolean initial, Object checkPoint); }
S3ConfigurationSource implements PolledConfigurationSource { @Override public PollResult poll(boolean initial, Object checkPoint) throws IOException, AmazonServiceException { GetObjectRequest s3request = new GetObjectRequest(bucketName, key); InputStream is = null; try { S3Object result = client.getObject(s3request); is = result.getObjectContent(); Map<String,Object> resultMap = inputStreamToMap(is); return PollResult.createFull(resultMap); } finally { if (is!=null) is.close(); } } S3ConfigurationSource(AWSCredentialsProvider credentialsProvider, String bucketName, String key);  S3ConfigurationSource(AmazonS3 client, String bucketName, String key); @Override PollResult poll(boolean initial, Object checkPoint);  }