Package aQute.libg.shacache
Class ShaCache
java.lang.Object
aQute.libg.shacache.ShaCache
Provide a standardized cache based on the SHA-1 of a file.
-
Field Details
-
SHA_P
-
root
-
-
Constructor Details
-
ShaCache
Create a SHA-1 cache on a directory.- Parameters:
root
- the directory
-
-
Method Details
-
getStream
Return a stream that is associated with a SHA. If the SHA is not in the local cache, the given sources parameter can specify a way to get the content.- Parameters:
sha
- the shasources
- objects that can retrieve the original data- Returns:
- the stream or null if not found.
- Throws:
Exception
-
getFile
Small variation on the cache that returns a file instead of a stream- Parameters:
sha
- the SHA-1sources
- the inputs- Returns:
- a file or null
- Throws:
Exception
-
purge
Clean the cache- Throws:
Exception
-
getRoot
Get the root to the cache
-