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 class
LegacyProjectImporter.SerializedCell
Helper class to deserialize a cell as serialized by OpenRefine up to 3.x.protected static class
LegacyProjectImporter.SerializedRow
Legacy 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 ColumnModel
loadColumnModel(LineNumberReader reader)
protected void
loadGrid(LineNumberReader reader, List<LegacyProjectImporter.SerializedRow> grid)
protected void
loadPool(LineNumberReader reader, Map<Long,Recon> pool)
Grid
parseOneFile(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 anInputStream
object, into a Grid.protected void
skipHistory(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:InputStreamImporter
Parses one file, read from anInputStream
object, into a Grid.- Specified by:
parseOneFile
in 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)
-
-