|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gisgraphy.domain.geoloc.importer.AbstractFileRetriever
public abstract class AbstractFileRetriever
Base class to download files from a server
Field Summary | |
---|---|
protected java.lang.String |
currentFileName
|
protected int |
fileIndex
|
protected ImporterConfig |
importerConfig
|
protected static org.slf4j.Logger |
logger
The logger |
protected int |
numberOfFileToDownload
|
protected ImporterStatus |
status
|
protected java.lang.String |
statusMessage
|
Constructor Summary | |
---|---|
AbstractFileRetriever()
|
Method Summary | |
---|---|
abstract void |
decompressFiles()
Method to call if files must be decompress (untar or unzip) |
protected void |
downloadFiles()
|
java.lang.String |
getCurrentFileName()
|
abstract java.lang.String |
getDownloadBaseUrl()
|
abstract java.lang.String |
getDownloadDirectory()
|
abstract java.io.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()
|
java.lang.String |
getStatusMessage()
|
long |
getTotalReadLine()
The number of read line for all the processed file |
void |
process()
Do the stuff... |
void |
resetStatus()
Reset status fields, it should be done when the import has been canceled |
java.util.List<NameValueDTO<java.lang.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 java.lang.String currentFileName
protected ImporterStatus status
protected int fileIndex
protected int numberOfFileToDownload
protected java.lang.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()
public boolean shouldBeSkipped()
shouldBeSkipped
in interface IImporterProcessor
public abstract void decompressFiles() throws java.io.IOException
java.io.IOException
public abstract java.io.File[] getFilesToDecompress() throws java.io.IOException
java.io.IOException
public abstract java.lang.String getDownloadDirectory()
public abstract java.lang.String getDownloadBaseUrl()
public long getReadFileLine()
IImporterProcessor
getReadFileLine
in interface IImporterProcessor
IImporterProcessor.getTotalReadLine()
public long getTotalReadLine()
IImporterProcessor
getTotalReadLine
in interface IImporterProcessor
IImporterProcessor.getReadFileLine()
public java.lang.String getCurrentFileName()
getCurrentFileName
in interface IImporterProcessor
public long getNumberOfLinesToProcess()
getNumberOfLinesToProcess
in interface IImporterProcessor
public ImporterStatus getStatus()
getStatus
in interface IImporterProcessor
public java.lang.String getStatusMessage()
getStatusMessage
in interface IImporterProcessor
public java.util.List<NameValueDTO<java.lang.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 |