From: <aki...@us...> - 2014-12-17 19:21:02
|
Revision: 9732 http://sourceforge.net/p/gridarta/code/9732 Author: akirschbaum Date: 2014-12-17 19:20:52 +0000 (Wed, 17 Dec 2014) Log Message: ----------- Tentative fix for incorrect map file names. Modified Paths: -------------- trunk/src/model/src/main/java/net/sf/gridarta/model/io/PathManager.java trunk/src/utils/src/main/java/net/sf/gridarta/utils/IOUtils.java Modified: trunk/src/model/src/main/java/net/sf/gridarta/model/io/PathManager.java =================================================================== --- trunk/src/model/src/main/java/net/sf/gridarta/model/io/PathManager.java 2014-12-07 21:54:19 UTC (rev 9731) +++ trunk/src/model/src/main/java/net/sf/gridarta/model/io/PathManager.java 2014-12-17 19:20:52 UTC (rev 9732) @@ -83,7 +83,7 @@ public MapFile getMapFile(@NotNull final File file) { final String canonicalFile = IOUtils.getCanonicalPath(file); final File mapsDirectory = projectSettings.getMapsDirectory(); - final String canonicalMapsDir = IOUtils.getCanonicalPath(mapsDirectory) + File.separator; + final String canonicalMapsDir = IOUtils.getCanonicalPath(mapsDirectory) + "/"; final String mapPath; final File baseDir; if (canonicalFile.startsWith(canonicalMapsDir)) { Modified: trunk/src/utils/src/main/java/net/sf/gridarta/utils/IOUtils.java =================================================================== --- trunk/src/utils/src/main/java/net/sf/gridarta/utils/IOUtils.java 2014-12-07 21:54:19 UTC (rev 9731) +++ trunk/src/utils/src/main/java/net/sf/gridarta/utils/IOUtils.java 2014-12-17 19:20:52 UTC (rev 9732) @@ -197,11 +197,13 @@ */ @NotNull public static String getCanonicalPath(@NotNull final File file) { + String path; try { - return file.getCanonicalPath(); + path = file.getCanonicalPath(); } catch (final IOException ignored) { - return file.getAbsolutePath(); + path = file.getAbsolutePath(); } + return path.replace(File.separatorChar, '/'); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |