Package us.codecraft.webmagic.pipeline
Class JsonFilePageModelPipeline
java.lang.Object
us.codecraft.webmagic.utils.FilePersistentBase
us.codecraft.webmagic.pipeline.JsonFilePageModelPipeline
- All Implemented Interfaces:
PageModelPipeline
public class JsonFilePageModelPipeline
extends us.codecraft.webmagic.utils.FilePersistentBase
implements PageModelPipeline
Store results objects (page models) to files in JSON format.
Use model.getKey() as file name if the model implements HasKey.
Otherwise use SHA1 as file name.
Use model.getKey() as file name if the model implements HasKey.
Otherwise use SHA1 as file name.
- Since:
- 0.2.0
- Author:
- code4crafter@gmail.com
-
Field Summary
Fields inherited from class us.codecraft.webmagic.utils.FilePersistentBase
path, PATH_SEPERATOR
-
Constructor Summary
ConstructorDescriptionnew JsonFilePageModelPipeline with default path "/data/webmagic/" -
Method Summary
Methods inherited from class us.codecraft.webmagic.utils.FilePersistentBase
checkAndMakeParentDirecotry, getFile, getPath, setPath
-
Constructor Details
-
JsonFilePageModelPipeline
public JsonFilePageModelPipeline()new JsonFilePageModelPipeline with default path "/data/webmagic/" -
JsonFilePageModelPipeline
-
-
Method Details
-
process
- Specified by:
process
in interfacePageModelPipeline
-