Package gov.usgs.earthquake.product.io
Class JsonProductSource
java.lang.Object
gov.usgs.earthquake.product.io.JsonProductSource
- All Implemented Interfaces:
ProductSource
Load a product from an InputStream containing Json.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new JsonProductSource.JsonProductSource(InputStream in, Path directory) Create a new JsonProductSource. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Free any resources associated with this handler.javax.json.JsonObjectparseContents(javax.json.JsonObject contentsObject) parseDirectoryJson(javax.json.JsonObject json) voidstreamTo(ProductHandler out) Begin reading the input stream, sending events to out.
-
Constructor Details
-
JsonProductSource
Create a new JsonProductSource.- Parameters:
in- the input stream where Json is read.
-
JsonProductSource
Create a new JsonProductSource.- Parameters:
in- the input stream where Json is read.directory- the directory where a product exists.
-
-
Method Details
-
parseContents
- Throws:
Exception
-
parseDirectoryJson
- Throws:
Exception
-
streamTo
Begin reading the input stream, sending events to out.- Specified by:
streamToin interfaceProductSource- Parameters:
out- the receiving ProductOutput.- Throws:
Exception- if error occurs
-
close
public void close()Free any resources associated with this handler.- Specified by:
closein interfaceProductSource
-