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 TypeMethodDescriptionvoid
close()
Free any resources associated with this handler.javax.json.JsonObject
parseContents
(javax.json.JsonObject contentsObject) parseDirectoryJson
(javax.json.JsonObject json) void
streamTo
(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:
streamTo
in interfaceProductSource
- Parameters:
out
- the receiving ProductOutput.- Throws:
Exception
- if error occurs
-
close
public void close()Free any resources associated with this handler.- Specified by:
close
in interfaceProductSource
-