com.gisgraphy.importer

## Class OpenStreetMapCitiesFileRetriever

- java.lang.Object
- - com.gisgraphy.importer.AbstractFileRetriever
  - - com.gisgraphy.importer.OpenStreetMapCitiesFileRetriever

- All Implemented Interfaces:
    IImporterProcessor

      public class OpenStreetMapCitiesFileRetriever
      extends AbstractFileRetriever

  Retrieve The openstreetmap cities files from a server
  Author:
    David Masclet

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.slf4j.Logger` | `logger`

    - ### Fields inherited from class com.gisgraphy.importer.AbstractFileRetriever

      `currentFileName, fileIndex, importerConfig, numberOfFileToDownload, status, statusMessage`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OpenStreetMapCitiesFileRetriever()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `decompressFiles()` Method to call if files must be decompress (untar or unzip)
    `String` | `getcurrentExtractedFileNameIntoArchive()`
    `String` | `getDownloadBaseUrl()`
    `String` | `getDownloadDirectory()`
    `File[]` | `getFilesToDecompress()` return an array of file that are to be decompressed
    `boolean` | `isFileNotFoundTolerant()`
    `boolean` | `shouldBeSkipped()`

    - ### Methods inherited from class com.gisgraphy.importer.AbstractFileRetriever

      `downloadFile, downloadFiles, getCurrentFileName, getNumberOfLinesToProcess, getReadFileLine, getStatus, getStatusMessage, getTotalReadLine, process, resetStatus, rollback, setImporterConfig, setInternationalisationService`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          protected static final org.slf4j.Logger logger

  - ### Constructor Detail

    - #### OpenStreetMapCitiesFileRetriever

          public OpenStreetMapCitiesFileRetriever()

  - ### Method Detail

    - #### getcurrentExtractedFileNameIntoArchive

          public String getcurrentExtractedFileNameIntoArchive()

    - #### getDownloadDirectory

          public String getDownloadDirectory()

      Specified by:
        `getDownloadDirectory` in class `AbstractFileRetriever`
      Returns:
        The directory where the file should be downloaded

    - #### getDownloadBaseUrl

          public String getDownloadBaseUrl()

      Specified by:
        `getDownloadBaseUrl` in class `AbstractFileRetriever`
      Returns:
        the base URL from wich the file should be downloaded

    - #### decompressFiles

          public void decompressFiles()
                               throws IOException

      Description copied from class: `AbstractFileRetriever`
      Method to call if files must be decompress (untar or unzip)
      Specified by:
        `decompressFiles` in class `AbstractFileRetriever`
      Throws:
        `IOException`

    - #### shouldBeSkipped

          public boolean shouldBeSkipped()

      Specified by:
        `shouldBeSkipped` in interface `IImporterProcessor`
      Overrides:
        `shouldBeSkipped` in class `AbstractFileRetriever`
      Returns:
        true if the processor should Not be executed

    - #### getFilesToDecompress

          public File[] getFilesToDecompress()
                                      throws IOException

      Description copied from class: `AbstractFileRetriever`
      return an array of file that are to be decompressed
      Specified by:
        `getFilesToDecompress` in class `AbstractFileRetriever`
      Throws:
        `IOException`

    - #### isFileNotFoundTolerant

          public boolean isFileNotFoundTolerant()

      Specified by:
        `isFileNotFoundTolerant` in class `AbstractFileRetriever`
      Returns:
        false if download files that doesn't exists on the remote server should throw

Copyright © 2015. All rights reserved.