Package org.openrefine.importers
Class LegacyProjectImporter
- java.lang.Object
-
- org.openrefine.importers.ImportingParserBase
-
- org.openrefine.importers.InputStreamImporter
-
- org.openrefine.importers.LegacyProjectImporter
-
- All Implemented Interfaces:
ImportingParser
public class LegacyProjectImporter extends InputStreamImporter
Imports an OpenRefine project from a 3.x project archive.- Author:
- Antonin Delpeuch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classLegacyProjectImporter.SerializedCellHelper class to deserialize a cell as serialized by OpenRefine up to 3.x.protected static classLegacyProjectImporter.SerializedRowLegacy serialized version of a row, only used to read old projects.
-
Constructor Summary
Constructors Constructor Description LegacyProjectImporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ColumnModelloadColumnModel(LineNumberReader reader)protected voidloadGrid(LineNumberReader reader, List<LegacyProjectImporter.SerializedRow> grid)protected voidloadPool(LineNumberReader reader, Map<Long,Recon> pool)GridparseOneFile(Runner runner, ProjectMetadata metadata, ImportingJob job, String fileSource, String archiveFileName, Supplier<InputStream> inputStreamSupplier, long limit, com.fasterxml.jackson.databind.node.ObjectNode options)Parses one file, read from anInputStreamobject, into a Grid.protected voidskipHistory(LineNumberReader reader)-
Methods inherited from class org.openrefine.importers.ImportingParserBase
createParserUIInitializationData, parse, parseOneFile
-
-
-
-
Method Detail
-
parseOneFile
public Grid parseOneFile(Runner runner, ProjectMetadata metadata, ImportingJob job, String fileSource, String archiveFileName, Supplier<InputStream> inputStreamSupplier, long limit, com.fasterxml.jackson.databind.node.ObjectNode options) throws Exception
Description copied from class:InputStreamImporterParses one file, read from anInputStreamobject, into a Grid.- Specified by:
parseOneFilein classInputStreamImporter- Parameters:
runner- the runner to use (the returned Grid will be generated by it)metadata- the project metadata associated with the project to parse (which can be modified by the importer)job- the importing job where this import is being donefileSource- the path or source of the file (could be "clipboard" or a URL as well)archiveFileName- the path or source of the archive which contained this fileinputStreamSupplier- the input stream where to read the data fromlimit- the maximum number of rows to readoptions- any options passed to the importer as a JSON payload- Returns:
- a parsed Grid
- Throws:
Exception
-
loadColumnModel
protected ColumnModel loadColumnModel(LineNumberReader reader) throws IOException
- Throws:
IOException
-
skipHistory
protected void skipHistory(LineNumberReader reader) throws IOException
- Throws:
IOException
-
loadPool
protected void loadPool(LineNumberReader reader, Map<Long,Recon> pool) throws IOException
- Throws:
IOException
-
loadGrid
protected void loadGrid(LineNumberReader reader, List<LegacyProjectImporter.SerializedRow> grid)
-
-