|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gisgraphy.importer.AbstractFileRetriever
public abstract class AbstractFileRetriever
Base class to download files from a server
Field Summary | |
---|---|
protected String |
currentFileName
|
protected int |
fileIndex
|
protected ImporterConfig |
importerConfig
|
protected static org.slf4j.Logger |
logger
The logger |
protected int |
numberOfFileToDownload
|
protected ImporterStatus |
status
|
protected String |
statusMessage
|
Constructor Summary | |
---|---|
AbstractFileRetriever()
|
Method Summary | |
---|---|
abstract void |
decompressFiles()
Method to call if files must be decompress (untar or unzip) |
protected void |
downloadFile(String file)
|
protected void |
downloadFiles()
|
String |
getCurrentFileName()
|
abstract String |
getDownloadBaseUrl()
|
abstract String |
getDownloadDirectory()
|
abstract File[] |
getFilesToDecompress()
return an array of file that are to be decompressed |
long |
getNumberOfLinesToProcess()
|
long |
getReadFileLine()
The number of read line for the current processed file |
ImporterStatus |
getStatus()
|
String |
getStatusMessage()
|
long |
getTotalReadLine()
The number of read line for all the processed file |
abstract boolean |
isFileNotFoundTolerant()
|
void |
process()
Do the stuff... |
void |
resetStatus()
Reset status fields, it should be done when the import has been canceled |
List<NameValueDTO<Integer>> |
rollback()
/! |
void |
setImporterConfig(ImporterConfig importerConfig)
|
void |
setInternationalisationService(IInternationalisationService internationalisationService)
|
boolean |
shouldBeSkipped()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ImporterConfig importerConfig
protected String currentFileName
protected ImporterStatus status
protected int fileIndex
protected int numberOfFileToDownload
protected String statusMessage
protected static final org.slf4j.Logger logger
Constructor Detail |
---|
public AbstractFileRetriever()
Method Detail |
---|
public void process() throws ImporterException
IImporterProcessor
process
in interface IImporterProcessor
ImporterException
protected void downloadFiles()
protected void downloadFile(String file) throws FileNotFoundException
FileNotFoundException
public abstract boolean isFileNotFoundTolerant()
public boolean shouldBeSkipped()
shouldBeSkipped
in interface IImporterProcessor
public abstract void decompressFiles() throws IOException
IOException
public abstract File[] getFilesToDecompress() throws IOException
IOException
public abstract String getDownloadDirectory()
public abstract String getDownloadBaseUrl()
public long getReadFileLine()
IImporterProcessor
getReadFileLine
in interface IImporterProcessor
IImporterProcessor.getTotalReadLine()
public long getTotalReadLine()
IImporterProcessor
getTotalReadLine
in interface IImporterProcessor
IImporterProcessor.getReadFileLine()
public String getCurrentFileName()
getCurrentFileName
in interface IImporterProcessor
public long getNumberOfLinesToProcess()
getNumberOfLinesToProcess
in interface IImporterProcessor
public ImporterStatus getStatus()
getStatus
in interface IImporterProcessor
public String getStatusMessage()
getStatusMessage
in interface IImporterProcessor
public List<NameValueDTO<Integer>> rollback()
IImporterProcessor
rollback
in interface IImporterProcessor
public void resetStatus()
IImporterProcessor
resetStatus
in interface IImporterProcessor
public void setImporterConfig(ImporterConfig importerConfig)
importerConfig
- The importerConfig to setpublic void setInternationalisationService(IInternationalisationService internationalisationService)
internationalisationService
- the internationalisationService to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |