com.atlassian.plugin.cache.filecache.impl
Class CachedFile
java.lang.Object
com.atlassian.plugin.cache.filecache.impl.CachedFile
public class CachedFile
- extends Object
Caches the contents of a stream, and deletes the cache when asked to do so.
This class encapsulates the lifecycle of a cached file, from as-yet-uncached, to cached, to needs-deletion, to deleted.
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.
- Since:
- v2.13
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachedFile
public CachedFile(File tmpFile)
stream
public void stream(OutputStream dest,
FileCacheStreamProvider input)
throws DownloadException
- Throws:
DownloadException
deleteWhenPossible
public void deleteWhenPossible()
Copyright © 2013 Atlassian. All Rights Reserved.