Package org.openrefine.importing
Class ImportingJob
- java.lang.Object
-
- org.openrefine.importing.ImportingJob
-
public class ImportingJob extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImportingJob.ImportingJobConfig
static class
ImportingJob.RetrievalRecord
-
Field Summary
Fields Modifier and Type Field Description boolean
canceled
File
dir
long
id
long
lastTouched
ProjectMetadata
metadata
boolean
updating
-
Constructor Summary
Constructors Constructor Description ImportingJob(long id, File dir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
autoSelectFiles()
Figure out the best (most common) format for the set of files, select all files which match that format, and return the format found.void
dispose()
String
getCommonFormatForSelectedFiles()
Returns the most common format among the selected files.List<Integer>
getFileSelection()
ImportingJob.ImportingJobConfig
getJsonConfig()
Project
getProject()
File
getRawDataDir()
ImportingJob.RetrievalRecord
getRetrievalRecord()
List<ImportingFileRecord>
getSelectedFileRecords()
String
guessBetterFormat(String bestFormat)
Guesses a better format by inspecting the first file to import with format guessers.void
setError(List<Exception> exceptions)
void
setFileSelection(List<Integer> fileSelectionArray)
void
setProgress(int percent, String message)
void
setProject(Project newProject)
void
setProjectID(long projectID)
void
setRankedFormats(List<String> rankedFormats)
void
setState(String state)
void
touch()
void
updateWithNewFileSelection(List<Integer> fileSelectionArray)
-
-
-
Field Detail
-
id
public final long id
-
dir
public final File dir
-
metadata
public ProjectMetadata metadata
-
lastTouched
public long lastTouched
-
updating
public boolean updating
-
canceled
public boolean canceled
-
-
Constructor Detail
-
ImportingJob
public ImportingJob(long id, File dir)
-
-
Method Detail
-
getJsonConfig
public ImportingJob.ImportingJobConfig getJsonConfig()
-
setState
public void setState(String state)
-
setProjectID
public void setProjectID(long projectID)
-
setProgress
public void setProgress(int percent, String message)
-
getRetrievalRecord
public ImportingJob.RetrievalRecord getRetrievalRecord()
-
getSelectedFileRecords
public List<ImportingFileRecord> getSelectedFileRecords()
-
touch
public void touch()
-
setProject
public void setProject(Project newProject)
-
getProject
public Project getProject()
-
dispose
public void dispose()
-
getRawDataDir
public File getRawDataDir()
-
getCommonFormatForSelectedFiles
public String getCommonFormatForSelectedFiles()
Returns the most common format among the selected files.- Returns:
- the most common format found, or null if no format could be guessed.
-
guessBetterFormat
public String guessBetterFormat(String bestFormat)
Guesses a better format by inspecting the first file to import with format guessers.- Parameters:
bestFormat
- the best format guessed so far- Returns:
- any better format, or the current best format
-
autoSelectFiles
public String autoSelectFiles()
Figure out the best (most common) format for the set of files, select all files which match that format, and return the format found.- Returns:
- best (highest frequency) format
-
-