S3BinaryStore extends AbstractBinaryStore { @Override public String getExtractedText(BinaryValue binaryValue) throws BinaryStoreException { try { String key = binaryValue.getKey().toString(); ObjectMetadata metadata = s3Client.getObjectMetadata(bucketName, key); return metadata.getUserMetadata().get(EXTRACTED_TEXT_KEY); } catch (AmazonClientException e) { throw new BinaryStoreException(e); } } S3BinaryStore(String accessKey, String secretKey, String bucketName);  S3BinaryStore(String accessKey, String secretKey, String bucketName, String endPoint);  S3BinaryStore( String accessKey,
                          String secretKey,
                          String bucketName,
                          String endPoint,
                          Boolean deleteUnusedNatively ); protected  S3BinaryStore(String bucketName, AmazonS3 s3Client, boolean deleteUnusedNatively); @Override void storeExtractedText(BinaryValue binaryValue, String extractedText); @Override String getExtractedText(BinaryValue binaryValue); @Override BinaryValue storeValue(InputStream stream, boolean markAsUnused); @Override InputStream getInputStream(BinaryKey key); @Override void markAsUsed(Iterable<BinaryKey> keys); @Override void markAsUnused(Iterable<BinaryKey> keys); @Override void removeValuesUnusedLongerThan(long minimumAge, TimeUnit timeUnit); @Override Iterable<BinaryKey> getAllBinaryKeys(); void migrateUnusedMetadataToTags();  }
@Test public void testGetExtractedText() throws BinaryStoreException { String extractedText = "text-that-has-been-extracted"; ObjectMetadata objMeta = new ObjectMetadata(); Map<String, String> userMeta = new HashMap<>(); userMeta.put(S3BinaryStore.EXTRACTED_TEXT_KEY, extractedText); objMeta.setUserMetadata(userMeta); expect(s3Client.getObjectMetadata(BUCKET, TEST_KEY)).andReturn(objMeta); replayAll(); BinaryValue binaryValue = createBinaryValue(TEST_KEY, TEST_CONTENT); String extractValue = s3BinaryStore.getExtractedText(binaryValue); assertEquals(extractedText, extractValue); }