de.deepamehta.plugins.csv
Class CsvPlugin
java.lang.Object
de.deepamehta.core.osgi.PluginActivator
de.deepamehta.plugins.csv.CsvPlugin
- All Implemented Interfaces:
- PluginContext, org.osgi.framework.BundleActivator
public class CsvPlugin
- extends PluginActivator
log
private static Logger log
FOLDER
public static final String FOLDER
- See Also:
- Constant Field Values
SEPARATOR
public static final char SEPARATOR
- See Also:
- Constant Field Values
isInitialized
private boolean isInitialized
fileService
private FilesService fileService
CsvPlugin
public CsvPlugin()
importCsv
public ImportStatus importCsv(String typeUri,
long fileId,
@HeaderParam(value="Cookie")
ClientState cookie)
getPossibleAggrChilds
private Map<String,Map<String,Long>> getPossibleAggrChilds(String typeUri,
List<String> childTypeUris)
- get all possible aggregation instances and hash them by typeUri and value
- Parameters:
typeUri
- childTypeUris
-
- Returns:
getTopicIdsByValue
private Map<String,Long> getTopicIdsByValue(String childTypeUri)
- get all existing instance topics and hash them by value
- Parameters:
childTypeUri
-
- Returns:
- instance topics hashed by value
getTopicIdsByUri
private Map<String,Long> getTopicIdsByUri(String typeUri)
- get all existing instance topics and hash them by URI
- Parameters:
typeUri
-
- Returns:
- instance topics hashed by URI
readCsvFile
private List<String[]> readCsvFile(long fileId)
throws IOException
- read and validate CSV file
- Parameters:
fileId
-
- Returns:
- parsed CSV rows with trimmed column array
- Throws:
FileNotFoundException
IOException
init
public void init()
- Initialize.
- Specified by:
init
in interface PluginContext
- Overrides:
init
in class PluginActivator
serviceArrived
public void serviceArrived(PluginService service)
- Specified by:
serviceArrived
in interface PluginContext
- Overrides:
serviceArrived
in class PluginActivator
serviceGone
public void serviceGone(PluginService service)
- Specified by:
serviceGone
in interface PluginContext
- Overrides:
serviceGone
in class PluginActivator
configureIfReady
private void configureIfReady()
createCsvDirectory
private void createCsvDirectory()
Copyright © 2014. All Rights Reserved.