A store for binary data.
Binary data is given as a stream of bytes. The stream is saved in chunks, where each chunk is stored into a blob object (in contrast to use one blob for the whole data). This makes it possible to effectively retrieve partial content.
- Companion
- object
Value members
Abstract methods
Adds a new chunk of data to a file.
Adds a new chunk of data to a file.
Creates or updates the corresponding FileMeta record and returns it. This is useful if you get chunks of data in some random order.
If the chunk already exists with correct length, the return value is wrapped in Outcome.Unmodified and the given chunk is not written, otherwise a Outcome#Created is returned and the chunk is stored.
Return whether a file with given id has a chunk with the given chunkNr.
Return whether a file with given id has a chunk with the given chunkNr.
Like
Like
chunkExists}} but also checks the chunk size. If a chunk
with different size exists, it is removed and {{{false
is returned.
with different size exists, it is removed and {{{false }}} returned.
Fetch data using one connection per chunk. So connections are closed immediately after reading a chunk.
Fetch data using one connection per chunk. So connections are closed immediately after reading a chunk.
Fetch data using one connection for the whole stream. It is closed once the stream terminates.
Fetch data using one connection for the whole stream. It is closed once the stream terminates.
“Merge” duplicates.
“Merge” duplicates.
If the given
meta
object contains a random id (as returned from
saveNew
), check for duplicates using its checksum.
If a duplicate is found, delete
meta
and its data and return the just found value. If no duplicate is found, update the id of
meta
to be its checksum.
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
meta }}}
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
meta }}} return the just found value. If no duplicate is found, update the id of
meta
to be its checksum.
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
meta }}}
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
saveNew }}}
If a duplicate is found, delete
meta
and its data and return the just found value. If no duplicate is found, update the id of
meta
to be its checksum.
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
meta }}}
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
meta }}} return the just found value. If no duplicate is found, update the id of
meta
to be its checksum.
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
meta }}}
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
meta }}} from
saveNew
), check for duplicates using its checksum.
If a duplicate is found, delete
meta
and its data and return the just found value. If no duplicate is found, update the id of
meta
to be its checksum.
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
meta }}}
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
meta }}} return the just found value. If no duplicate is found, update the id of
meta
to be its checksum.
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
meta }}}
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
saveNew }}}
If a duplicate is found, delete
meta
and its data and return the just found value. If no duplicate is found, update the id of
meta
to be its checksum.
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
meta }}}
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
meta }}} return the just found value. If no duplicate is found, update the id of
meta
to be its checksum.
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
meta }}}
Return
Outcome.Unmodified
if there was a duplicate, or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Outcome.Unmodified }}} or
Outcome.Created
if there was no duplicate.
Outcome.Created }}}
Save data in chunks of size chunkSize
and use a random id.
Save data in chunks of size chunkSize
and use a random id.
Concrete methods
Save data in chunks of size chunkSize
and check for duplicates.
Save data in chunks of size chunkSize
and check for duplicates.
Return either
Outcome.Created
if new data has been written (no duplicates) or
Outcome.Unmodified
if no data was written and the duplicate is returned.
Outcome.Unmodified }}} written and the duplicate is returned.
Outcome.Created }}} (no duplicates) or
Outcome.Unmodified
if no data was written and the duplicate is returned.
Outcome.Unmodified }}} written and the duplicate is returned.