Package org.ossreviewtoolkit.model.utils
Class PostgresProvenanceFileStorage
-
- All Implemented Interfaces:
-
org.ossreviewtoolkit.model.utils.ProvenanceFileStorage
public final class PostgresProvenanceFileStorage implements ProvenanceFileStorage
A DataSource-based implementation of ProvenanceFileStorage that stores files associated by KnownProvenance in a (Postgres) database.
-
-
Constructor Summary
Constructors Constructor Description PostgresProvenanceFileStorage(Lazy<DataSource> dataSource, String tableName)
-
Method Summary
Modifier and Type Method Description BooleanhasData(KnownProvenance provenance)Return whether any data is associated by provenance. UnitputData(KnownProvenance provenance, InputStream data, Long size)Associate provenance with the given data of the provided size. InputStreamgetData(KnownProvenance provenance)Return the data associated by provenance, or null if there is no such data. -
-
Constructor Detail
-
PostgresProvenanceFileStorage
PostgresProvenanceFileStorage(Lazy<DataSource> dataSource, String tableName)
-
-
Method Detail
-
hasData
Boolean hasData(KnownProvenance provenance)
Return whether any data is associated by provenance.
-
putData
Unit putData(KnownProvenance provenance, InputStream data, Long size)
Associate provenance with the given data of the provided size. Replaces any existing association by provenance. The function implementation is responsible for closing the stream.
-
getData
InputStream getData(KnownProvenance provenance)
Return the data associated by provenance, or null if there is no such data. Note that it is the responsibility of the caller to close the stream.
-
-
-
-