Package org.moeaframework.analysis.store
Interface Container
public interface Container
A container of blobs.
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Returnstrue
if the blob identified by this name exists within this container.void
create()
Creates the underlying, physical container.boolean
delete()
Deletes this container if it exists, including all blobs contained within.boolean
exists()
Returnstrue
if the underlying, physical container exists.Gets a reference to a blob with the given name.Gets the data store managing this container.Gets the reference for this container.default URI
getURI()
Returns the URI for this container, which can be used withDataStoreFactory.resolveContainer(java.net.URI)
.Returns all blobs stored in this container.Returns a stream of all blobs stored in this container.default String
toJSON()
Returns the contents of this container formatted as JSON.default String
Returns the contents of this container formatted as JSON.default String
Returns the contents of this container formatted as JSON.
-
Method Details
-
getDataStore
DataStore getDataStore()Gets the data store managing this container.- Returns:
- the data store
-
getReference
Reference getReference()Gets the reference for this container.- Returns:
- the reference
-
getBlob
Gets a reference to a blob with the given name.- Parameters:
name
- the blob name- Returns:
- the blob reference
-
create
Creates the underlying, physical container. Containers are automatically created when writing a blob, so an explicit call to create the container is not required.- Throws:
DataStoreException
- if an error occurred accessing the data store
-
exists
Returnstrue
if the underlying, physical container exists.- Returns:
true
if the container exists;false
otherwise- Throws:
DataStoreException
- if an error occurred accessing the data store
-
delete
Deletes this container if it exists, including all blobs contained within.- Returns:
true
if the container was deleted;false
if the container does not exist- Throws:
DataStoreException
- if an error occurred accessing the data store
-
streamBlobs
Returns a stream of all blobs stored in this container. The caller must close the stream when finished.- Returns:
- a stream of blobs in this container
- Throws:
DataStoreException
- if an error occurred accessing the data store
-
listBlobs
Returns all blobs stored in this container.- Returns:
- the blobs in this container
- Throws:
DataStoreException
- if an error occurred accessing the data store
-
contains
Returnstrue
if the blob identified by this name exists within this container.- Parameters:
name
- the blob name- Returns:
true
if the blob exists;false
otherwise- Throws:
DataStoreException
- if an error occurred accessing the data store
-
getURI
Returns the URI for this container, which can be used withDataStoreFactory.resolveContainer(java.net.URI)
.- Returns:
- the URI
-
toJSON
Returns the contents of this container formatted as JSON.- Returns:
- the JSON string
-
toJSON
Returns the contents of this container formatted as JSON.- Parameters:
baseURI
- the base URI, which is used to produce URLs- Returns:
- the JSON string
-
toJSON
Returns the contents of this container formatted as JSON.- Parameters:
baseURI
- the base URI, which is used to produce URLsfull
- iftrue
, output the full data (can produce large output)- Returns:
- the JSON string
-