@Test public void shouldCleanupUnunsedValues() throws Exception { getBinaryStore().storeValue(new ByteArrayInputStream(IN_MEMORY_BINARY), false); List<BinaryKey> keys = new ArrayList<BinaryKey>(); keys.add(IN_MEMORY_KEY); getBinaryStore().markAsUnused(keys); Thread.sleep(100); getBinaryStore().removeValuesUnusedLongerThan(1, TimeUnit.MILLISECONDS); try { getBinaryStore().getInputStream(IN_MEMORY_KEY); fail("Key was not removed"); } catch (BinaryStoreException ex) { } }
@Override public BinaryValue storeValue( InputStream stream, String hint, boolean markAsUnused ) throws BinaryStoreException { return storeValue(stream, markAsUnused); }
AbstractBinaryStore implements BinaryStore { @Override public BinaryValue storeValue( InputStream stream, String hint, boolean markAsUnused ) throws BinaryStoreException { return storeValue(stream, markAsUnused); } }
AbstractBinaryStore implements BinaryStore { @Override public BinaryValue storeValue( InputStream stream, String hint, boolean markAsUnused ) throws BinaryStoreException { return storeValue(stream, markAsUnused); }  }
AbstractBinaryStore implements BinaryStore { @Override public BinaryValue storeValue( InputStream stream, String hint, boolean markAsUnused ) throws BinaryStoreException { return storeValue(stream, markAsUnused); }  static int bestBufferSize( long fileSize ); @Override long getMinimumBinarySizeInBytes(); @Override void setMinimumBinarySizeInBytes( long minSizeInBytes ); @Override void setTextExtractors( TextExtractors textExtractors ); @Override void setMimeTypeDetector( MimeTypeDetector mimeTypeDetector ); @Override final String getText( BinaryValue binary ); @Override String getMimeType( BinaryValue binary,
                               String name ); @Override boolean hasBinary( BinaryKey key ); abstract void storeExtractedText( BinaryValue source,
                                             String extractedText ); abstract String getExtractedText( BinaryValue source ); @Override BinaryValue storeValue( InputStream stream, String hint, boolean markAsUnused ); @Override void start(); @Override void shutdown(); }
AbstractBinaryStore implements BinaryStore { @Override public BinaryValue storeValue( InputStream stream, String hint, boolean markAsUnused ) throws BinaryStoreException { return storeValue(stream, markAsUnused); }  static int bestBufferSize( long fileSize ); @Override long getMinimumBinarySizeInBytes(); @Override void setMinimumBinarySizeInBytes( long minSizeInBytes ); @Override void setTextExtractors( TextExtractors textExtractors ); @Override void setMimeTypeDetector( MimeTypeDetector mimeTypeDetector ); @Override final String getText( BinaryValue binary ); @Override String getMimeType( BinaryValue binary,
                               String name ); @Override boolean hasBinary( BinaryKey key ); abstract void storeExtractedText( BinaryValue source,
                                             String extractedText ); abstract String getExtractedText( BinaryValue source ); @Override BinaryValue storeValue( InputStream stream, String hint, boolean markAsUnused ); @Override void start(); @Override void shutdown();  }