public class OneStreamCache extends StreamsCache
Calls to stream() always succeed, even if the cache was deleted. The initial call to stream() will block other callers to stream() and deleteWhenPossible().
Subsequent calls to stream() don't block other calls.
Subsequent calls to deleteWhenPossible() don't block.
A call to deleteWhenPossible() always results in the file being (eventually) deleted.
Both stream() and deleteWhenPossible() can be called multiple times, in any order, with any level of concurrency.
StreamsCache.Callback, StreamsCache.CallbackWithBooleanReturn| Constructor and Description |
|---|
OneStreamCache(File tmpFile) |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteWhenPossible() |
void |
stream(OutputStream out,
Cache.StreamProvider provider) |
protected void |
streamToCache(Cache.StreamProvider input) |
void |
streamTwo(OutputStream out1,
OutputStream out2,
Cache.TwoStreamProvider provider) |
createWriteStream, deleteWhenPossible, doEnter, doExit, setLogger, streamFromFileprotected final File tmpFile
public OneStreamCache(File tmpFile)
public void stream(OutputStream out, Cache.StreamProvider provider)
stream in class StreamsCachepublic void streamTwo(OutputStream out1, OutputStream out2, Cache.TwoStreamProvider provider)
streamTwo in class StreamsCachepublic void deleteWhenPossible()
deleteWhenPossible in class StreamsCacheprotected void streamToCache(Cache.StreamProvider input) throws IOException
IOExceptionCopyright © 2018 Atlassian. All rights reserved.