Skip to content

Instantly share code, notes, and snippets.

@andresrc
Created August 16, 2012 18:18
Show Gist options
  • Save andresrc/3372343 to your computer and use it in GitHub Desktop.
Save andresrc/3372343 to your computer and use it in GitHub Desktop.
Bocas Interface
public interface Bocas {
/*
* Checking if the repository contains entries.
*/
boolean contains(ByteString key);
Set<ByteString> contained(Iterable<ByteString> keys);
/*
* Obtaining entries.
*/
Optional<BocasValue> get(ByteString key);
Map<ByteString, BocasValue> get(Iterable<ByteString> keys);
/*
* Adding entries to the repository.
*/
ByteString put(InputSupplier<? extends InputStream> object);
ByteString put(InputStream object);
List<ByteString> putSuppliers(List<? extends InputSupplier<? extends InputStream>> objects);
List<ByteString> putStreams(List<? extends InputStream> objects);
/* Adding a set of entries to the repository, contained in a ZIP file. */
Map<String, ByteString> putZip(InputStream object);
Map<String, ByteString> putZip(InputSupplier<? extends InputStream> object);
/* Adding a set of entries to the repository, contained in a ZIP file, compressing them with GZip. */
Map<String, MaybeCompressed<ByteString>> putZipAndGZip(InputStream object);
Map<String, MaybeCompressed<ByteString>> putZipAndGZip(InputSupplier<? extends InputStream> object);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment