Package org.spdx.library
Class Write
java.lang.Object
org.spdx.library.Write
Static class to provide write operations to the model.
Some design and some implementation borrowed from Yevster's spdxtra project under the Apache 2.0 license
http://yevster.github.io/spdxtra/
- Author:
- Gary O'Neall
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyUpdatesInOneTransaction(String documentUri, IModelStore modelStore, Iterable<? extends IModelStore.ModelUpdate> updates) Apply a set of model updates in a single transaction.static voidapplyUpdatesInOneTransaction(String documentUri, IModelStore modelStore, IModelStore.ModelUpdate... updates) Convenience method for applying a small set of updates.static voiddeSerialize(ISerializableModelStore modelStore, String documentUri, InputStream stream) Deserialize a model store from an input stream.static voidreadFile(ISerializableModelStore modelStore, String documentUri, Path filePath) Reads a file into a model store
-
Constructor Details
-
Write
public Write()
-
-
Method Details
-
applyUpdatesInOneTransaction
public static void applyUpdatesInOneTransaction(String documentUri, IModelStore modelStore, IModelStore.ModelUpdate... updates) throws InvalidSPDXAnalysisException, IOException Convenience method for applying a small set of updates.- Parameters:
modelStore- Storage for the model objectsupdates- Updates to be applied in a single transaction- Throws:
IOExceptionInvalidSPDXAnalysisException
-
applyUpdatesInOneTransaction
public static void applyUpdatesInOneTransaction(String documentUri, IModelStore modelStore, Iterable<? extends IModelStore.ModelUpdate> updates) throws InvalidSPDXAnalysisException, IOException Apply a set of model updates in a single transaction. Updates can be gather from theSpdxModelFactoryor the model objects themselves from the update methods- Parameters:
modelStore- Storage for the model objectsupdates- Updates to be applied in a single transaction- Throws:
InvalidSPDXAnalysisExceptionIOException
-
deSerialize
public static void deSerialize(ISerializableModelStore modelStore, String documentUri, InputStream stream) throws InvalidSPDXAnalysisException, IOException Deserialize a model store from an input stream. The format of the input stream dependes on the Model Store implementation- Parameters:
modelStore- Storage for the model objectsdocumentUri- SPDX Document URI for a document associated with this modelstream- Input stream to deserialize the data- Throws:
InvalidSPDXAnalysisExceptionIOException
-
readFile
public static void readFile(ISerializableModelStore modelStore, String documentUri, Path filePath) throws InvalidSPDXAnalysisException, IOException Reads a file into a model store- Parameters:
modelStore-documentUri-filePath-- Throws:
InvalidSPDXAnalysisExceptionIOException
-