@Test public void testStoreExtractedTextTooLong() { StringBuilder textBuilder = new StringBuilder(); for (int i = 0; i < 2001; i++) { textBuilder.append("a"); } String extractedText = textBuilder.toString(); replayAll(); BinaryValue binaryValue = createBinaryValue(TEST_KEY, TEST_CONTENT); try { s3BinaryStore.storeExtractedText(binaryValue, extractedText); fail("Exception expected due to long extracted text value"); } catch(BinaryStoreException e) { assertNotNull(e); } }
@Override public void storeExtractedText(BinaryValue binaryValue, String extractedText) throws BinaryStoreException { if (extractedText.length() > 2000) { throw new BinaryStoreException("S3 objects cannot store associated data that is larger than 2KB"); } setS3ObjectUserProperty(binaryValue.getKey().toString(), EXTRACTED_TEXT_KEY, extractedText); }
S3BinaryStore extends AbstractBinaryStore { @Override public void storeExtractedText(BinaryValue binaryValue, String extractedText) throws BinaryStoreException { if (extractedText.length() > 2000) { throw new BinaryStoreException("S3 objects cannot store associated data that is larger than 2KB"); } setS3ObjectUserProperty(binaryValue.getKey().toString(), EXTRACTED_TEXT_KEY, extractedText); } }
S3BinaryStore extends AbstractBinaryStore { @Override public void storeExtractedText(BinaryValue binaryValue, String extractedText) throws BinaryStoreException { if (extractedText.length() > 2000) { throw new BinaryStoreException("S3 objects cannot store associated data that is larger than 2KB"); } setS3ObjectUserProperty(binaryValue.getKey().toString(), EXTRACTED_TEXT_KEY, extractedText); } 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); }
S3BinaryStore extends AbstractBinaryStore { @Override public void storeExtractedText(BinaryValue binaryValue, String extractedText) throws BinaryStoreException { if (extractedText.length() > 2000) { throw new BinaryStoreException("S3 objects cannot store associated data that is larger than 2KB"); } setS3ObjectUserProperty(binaryValue.getKey().toString(), EXTRACTED_TEXT_KEY, extractedText); } 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(); }
S3BinaryStore extends AbstractBinaryStore { @Override public void storeExtractedText(BinaryValue binaryValue, String extractedText) throws BinaryStoreException { if (extractedText.length() > 2000) { throw new BinaryStoreException("S3 objects cannot store associated data that is larger than 2KB"); } setS3ObjectUserProperty(binaryValue.getKey().toString(), EXTRACTED_TEXT_KEY, extractedText); } 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();  }