Reputation: 346
I have a AWS Transcribe job that gives me a URI when completed. This URI should be where the transcription text is stored. I want to access that text with the Java SDK, but GetObject does not seem to support this option. How do I access the text from the Transcribe job?
// I am given this
String URI = job.getTranscript().getTranscriptFileUri();
// I want to do this
S3Object transcript = s3.getObject(URI);
Upvotes: 2
Views: 642
Reputation: 553
You need to parse the bucket and the object key from the given URI, or you can use the provided class from AWS SDK, the AmazonS3URI. Then do as follows:
String URI = job.getTranscript().getTranscriptFileUri();
AmazonS3URI s3ObjectURI = new AmazonS3URI(URI);
S3Object transcript = s3.getObject(s3ObjectURI.getBucket(), s3ObjectURI.getKey());
Upvotes: 2