@Test @FixFor( "MODE-2302" ) public void shouldMarkBinariesAsUsed() throws Exception { BinaryStore binaryStore = getBinaryStore(); binaryStore.storeValue(new ByteArrayInputStream(IN_MEMORY_BINARY), false); binaryStore.markAsUnused(Arrays.asList(IN_MEMORY_KEY)); Thread.sleep(100); binaryStore.markAsUsed(Arrays.asList(IN_MEMORY_KEY)); Thread.sleep(2); binaryStore.removeValuesUnusedLongerThan(1, TimeUnit.MILLISECONDS); InputStream is = binaryStore.getInputStream(IN_MEMORY_KEY); assertNotNull(is); }
@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();  }