Class PathManager


  • public class PathManager
    extends java.lang.Object
    This class contains methods for converting relative map paths to absolute map paths and vice versa. Server-side, paths to maps always are URIs with the maps directory being the root directory for the maps. Therefore it makes sense to treat them as URIs in the editor as well.
    Todo:
    make more use of URI
    • Constructor Detail

      • PathManager

        public PathManager​(@NotNull
                           @NotNull ProjectSettings projectSettings)
        Creates a new instance.
        Parameters:
        projectSettings - the project settings instance for obtaining folder information
    • Method Detail

      • getMapPath

        @NotNull
        public @NotNull java.lang.String getMapPath​(@NotNull
                                                    @NotNull java.io.File file)
        Returns a map path for a File.
        Parameters:
        file - the file
        Returns:
        the map path
      • getMapFile

        @NotNull
        public @NotNull MapFile getMapFile​(@NotNull
                                           @NotNull AbsoluteMapPath mapPath)
        Returns a MapFile instance from an AbsoluteMapPath.
        Parameters:
        mapPath - the map path
        Returns:
        the map file instance
      • getMapFile

        @NotNull
        public @NotNull MapFile getMapFile​(@NotNull
                                           @NotNull java.io.File file)
        Returns a MapFile instance for a File. If the file points into the maps directory, a properly based map file is returned. Otherwise a map file based on the root directory is returned.
        Parameters:
        file - the file
        Returns:
        the map file instance