Package net.sf.gridarta.model.io
Class PathManager
- java.lang.Object
-
- net.sf.gridarta.model.io.PathManager
-
public class PathManager extends java.lang.ObjectThis 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 Summary
Constructors Constructor Description PathManager(@NotNull ProjectSettings projectSettings)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull MapFilegetMapFile(@NotNull java.io.File file)Returns aMapFileinstance for aFile.@NotNull MapFilegetMapFile(@NotNull AbsoluteMapPath mapPath)Returns aMapFileinstance from anAbsoluteMapPath.@NotNull java.lang.StringgetMapPath(@NotNull java.io.File file)Returns a map path for aFile.
-
-
-
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 aFile.- Parameters:
file- the file- Returns:
- the map path
-
getMapFile
@NotNull public @NotNull MapFile getMapFile(@NotNull @NotNull AbsoluteMapPath mapPath)
Returns aMapFileinstance from anAbsoluteMapPath.- Parameters:
mapPath- the map path- Returns:
- the map file instance
-
getMapFile
@NotNull public @NotNull MapFile getMapFile(@NotNull @NotNull java.io.File file)
Returns aMapFileinstance for aFile. 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
-
-