Class AtlasFilePathResolver

  • All Implemented Interfaces:
    java.io.Serializable

    public final class AtlasFilePathResolver
    extends java.lang.Object
    implements java.io.Serializable
    This resolver obscures whether or not the basePath points to a path containing Atlas files or country folders that contain the Atlas files. Path templates are configured through a key-value map, mapping schema to path template. The path template follows String.format(java.lang.String, java.lang.Object...) rules, given a base path and country code to determine the final path.

    Sample Configuration:
     {
       "AtlasFilePathResolver": {
         "schema.path.templates": {
             "file": "%s"
             "http": "%s/%s"
         }
       }
     }
     
    If no schema templates are found, country specific sub-folders are assumed and "%s/%s" is used.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      AtlasFilePathResolver​(org.openstreetmap.atlas.utilities.configuration.Configuration configuration)
      Default constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String resolvePath​(java.lang.String basePath, java.lang.String country)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AtlasFilePathResolver

        public AtlasFilePathResolver​(org.openstreetmap.atlas.utilities.configuration.Configuration configuration)
        Default constructor
        Parameters:
        configuration - The Configuration
    • Method Detail

      • resolvePath

        public java.lang.String resolvePath​(java.lang.String basePath,
                                            java.lang.String country)
        Parameters:
        basePath - the base directory, which contains either the country directories or the atlas files themselves
        country - the atlas file country we're interested in
        Returns:
        the correct path to look for Atlas files, based on the base path backend