public class CAFS extends java.lang.Object implements java.io.Closeable, java.lang.Iterable<SHA1>
| Constructor and Description |
|---|
CAFS(java.io.File home,
boolean create)
Constructor for a Content Addressable File Store
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
exists(byte[] sha1) |
boolean |
isEmpty() |
java.util.Iterator<SHA1> |
iterator() |
java.io.InputStream |
read(SHA1 sha1)
Read the contents of a sha 1 key.
|
void |
reindex() |
SHA1 |
write(java.io.InputStream in)
Store an input stream in the CAFS while calculating and returning the
SHA-1 code.
|
public CAFS(java.io.File home,
boolean create)
throws java.lang.Exception
home - create - java.lang.Exceptionpublic SHA1 write(java.io.InputStream in) throws java.lang.Exception
in - The input stream to store.java.lang.Exception - if anything goes wrongpublic java.io.InputStream read(SHA1 sha1) throws java.lang.Exception
sha1 - The keyjava.lang.Exceptionpublic boolean exists(byte[] sha1)
throws java.lang.Exception
java.lang.Exceptionpublic void reindex()
throws java.lang.Exception
java.lang.Exceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic java.util.Iterator<SHA1> iterator()
iterator in interface java.lang.Iterable<SHA1>public boolean isEmpty()
throws java.io.IOException
java.io.IOExceptionCopyright (c) aQute SARL (2000, 2017) and others. All Rights Reserved.