public class ShaCache
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.io.File |
root |
(package private) static java.util.regex.Pattern |
SHA_P |
Constructor and Description |
---|
ShaCache(java.io.File root)
Create a SHA-1 cache on a directory.
|
Modifier and Type | Method and Description |
---|---|
java.io.File |
getFile(java.lang.String sha,
ShaSource... sources)
Small variation on the cache that returns a file instead of a stream
|
java.io.File |
getRoot()
Get the root to the cache
|
java.io.InputStream |
getStream(java.lang.String sha,
ShaSource... sources)
Return a stream that is associated with a SHA.
|
void |
purge()
Clean the cache
|
public ShaCache(java.io.File root)
root
- the directorypublic java.io.InputStream getStream(java.lang.String sha, ShaSource... sources) throws java.lang.Exception
sha
- the shasources
- objects that can retrieve the original datajava.lang.Exception
public java.io.File getFile(java.lang.String sha, ShaSource... sources) throws java.lang.Exception
sha
- the SHA-1sources
- the inputsjava.lang.Exception
public void purge() throws java.lang.Exception
java.lang.Exception
public java.io.File getRoot()