public class CommonService extends Object
Modifier and Type | Field and Description |
---|---|
protected CoserBusinessConfig |
config |
Modifier and Type | Method and Description |
---|---|
protected void |
checkFileHeader(File file,
CoserConstants.Category category,
String[] line)
Check csv file header names and order depending on file category.
|
protected String |
getDataStorageFileName(Project project,
CoserConstants.Category category,
String suffix)
Deprecated.
since 1.5, use now
Project#getDataStorageFileName(Category, String) |
DataStorage |
getEmptyStorage(Project project,
CoserConstants.Category category)
Get empty storage for category (filled with just header)
|
Map<String,String[]> |
getOriginalContent(Project project,
CoserConstants.Category category,
Collection<String> lines)
Lit tout le fichier associé à la categorie demandé, mais ne retourne
que les données correspondant au numéro de lignes demandée.
|
Map<String,String[]> |
getOriginalFileContent(File file,
Collection<String> lines)
Lit le fichier demandé et sauve dans une map les lignes demandées.
|
String |
getReportDisplayName(Project project,
String species)
Retourne le nom d'affichage d'une especes pour les rapports.
|
DataStorage |
loadCSVFile(File file)
Charge un fichier csv (estcomind/estpopind ...) mais sans verification.
|
DataStorage |
loadCSVFile(File file,
char separator)
Charge un fichier csv (estcomind/estpopind ...) mais sans verification.
|
DataStorage |
loadCSVFile(Project project,
CoserConstants.Category category,
File file)
Load file as csv.
|
DataStorage |
loadCSVFile(Project project,
CoserConstants.Category category,
File file,
ProgressMonitor progress)
Load file as csv.
|
DataStorage |
loadCSVFile(Project project,
CoserConstants.Category category,
File file,
ProgressMonitor progress,
boolean originalLoading)
Load file as csv.
|
void |
storeData(DataStorage content,
File file)
Store project category data in specified file as csv.
|
void |
storeDataWhithoutQuote(DataStorage content,
File file,
Map<String,String> refTaxSpecies,
CoserConstants.Category category)
Deprecated.
since 1.4, prefer use of
#storeDataWhithoutQuote(DataStorage, Writer, Map, Category) |
void |
storeDataWhithoutQuote(DataStorage content,
Writer writer,
Map<String,String> refTaxSpecies,
CoserConstants.Category category)
Store data without quoting every columns with "" (r specific demand).
|
protected CoserBusinessConfig config
public DataStorage loadCSVFile(Project project, CoserConstants.Category category, File file) throws CoserBusinessException
project
- projectcategory
- categoryfile
- file to loadCoserBusinessException
public DataStorage loadCSVFile(Project project, CoserConstants.Category category, File file, ProgressMonitor progress) throws CoserBusinessException
project
- projectcategory
- categoryfile
- file to loadprogress
- progress monitor (can be null)CoserBusinessException
public DataStorage loadCSVFile(Project project, CoserConstants.Category category, File file, ProgressMonitor progress, boolean originalLoading) throws CoserBusinessException
project
- projectcategory
- categoryfile
- file to loadprogress
- progress monitor (can be null)originalLoading
- dans le cas d'un reload, la colonne "line" est a prendre en compte
pour les data (elle est absente dans les jeux de données originaux)CoserBusinessException
protected void checkFileHeader(File file, CoserConstants.Category category, String[] line) throws CoserBusinessException
file
- filecategory
- categoryline
- header line to ckeckCoserBusinessException
public DataStorage getEmptyStorage(Project project, CoserConstants.Category category)
project
- projectcategory
- categorypublic void storeData(DataStorage content, File file) throws CoserBusinessException
content
- content to savefile
- file to save toCoserBusinessException
public void storeDataWhithoutQuote(DataStorage content, File file, Map<String,String> refTaxSpecies, CoserConstants.Category category) throws CoserBusinessException
#storeDataWhithoutQuote(DataStorage, Writer, Map, Category)
content
- content to savefile
- file to save toproject
- project used only to get species output field (can be null)category
- category used to replace species output field if needed (can be null)CoserBusinessException
public void storeDataWhithoutQuote(DataStorage content, Writer writer, Map<String,String> refTaxSpecies, CoserConstants.Category category) throws CoserBusinessException
content
- content to savefile
- file to save toproject
- project used only to get species output field (can be null)category
- category used to replace species output field if needed (can be null)CoserBusinessException
public Map<String,String[]> getOriginalFileContent(File file, Collection<String> lines) throws CoserBusinessException
file
- file to readlines
- lines to save contentCoserBusinessException
public DataStorage loadCSVFile(File file) throws CoserBusinessException
file
- file to loadCoserBusinessException
public DataStorage loadCSVFile(File file, char separator) throws CoserBusinessException
file
- file to loadseparator
- separator to use to load fileCoserBusinessException
@Deprecated protected String getDataStorageFileName(Project project, CoserConstants.Category category, String suffix)
Project#getDataStorageFileName(Category, String)
project
- project (containing originals file names)category
- category to get file namesuffix
- suffix to add into file namepublic Map<String,String[]> getOriginalContent(Project project, CoserConstants.Category category, Collection<String> lines) throws CoserBusinessException
project
- projectcategory
- categorylines
- lines to get contentCoserBusinessException
Copyright © 2010–2015 Ifremer. All rights reserved.