Skip to content

Instantly share code, notes, and snippets.

@MarounMaroun
Last active July 21, 2016 08:25
Show Gist options
  • Select an option

  • Save MarounMaroun/6b1724bf0d8275d31794c7dce0129efc to your computer and use it in GitHub Desktop.

Select an option

Save MarounMaroun/6b1724bf0d8275d31794c7dce0129efc to your computer and use it in GitHub Desktop.
import scala.runtime.AbstractFunction1;
// somewhere
sc = ScalaClass.fromCustomFunc(new AbstractFunction1<String, List<String>>() {
@Override
public List<String> apply(String fn) {
BasicAWSCredentials AWSCredentials = new BasicAWSCredentials(AWS_ACCESS_KEY, AWS_SECRET_KEY);
AmazonS3Client amazonS3Client = new AmazonS3Client(AWSCredentials);
return getData(amazonS3Client.getObject(BUCKET, PATH + fn).getObjectContent());
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment