Package gov.usgs.earthquake.product.io
Class JsonDirectoryProductHandler
java.lang.Object
gov.usgs.earthquake.product.io.ObjectProductHandler
gov.usgs.earthquake.product.io.DirectoryProductHandler
gov.usgs.earthquake.product.io.JsonDirectoryProductHandler
- All Implemented Interfaces:
ProductHandler
Store a product to a Directory.
Product attributes are stored to a file named "product.json". All
ProductOutput methods are passed to an ObjectProductOutput object, except
files with non-empty paths. Files are stored in the directory, and all other
product attributes are stored using the product json format to a file name
"product.json".
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The file where product attributes are stored.Fields inherited from class gov.usgs.earthquake.product.io.DirectoryProductHandler
PRODUCT_XML_FILENAME
-
Constructor Summary
ConstructorsConstructorDescriptionJsonDirectoryProductHandler
(File directory) Construct a new DirectoryProductHandler object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Store all except product contents to product.json.Methods inherited from class gov.usgs.earthquake.product.io.DirectoryProductHandler
onContent
Methods inherited from class gov.usgs.earthquake.product.io.ObjectProductHandler
close, getProduct, getProduct, onBeginProduct, onLink, onProperty, onSignature, onSignatureHistory, onSignatureVersion
-
Field Details
-
PRODUCT_JSON_FILENAME
The file where product attributes are stored.- See Also:
-
-
Constructor Details
-
JsonDirectoryProductHandler
Construct a new DirectoryProductHandler object.- Parameters:
directory
- where product contents will be stored.
-
-
Method Details
-
onEndProduct
Store all except product contents to product.json.- Specified by:
onEndProduct
in interfaceProductHandler
- Overrides:
onEndProduct
in classDirectoryProductHandler
- Parameters:
id
- which product.- Throws:
Exception
- if error occurs
-