Issue #1439 - Cleanup of PR #1438 to enable UNC support

+ Uses Path.toRealPath() to satisfy requirements on both
  Windows and Linux respectively
This commit is contained in:
Joakim Erdfelt 2017-03-31 11:18:30 -07:00
parent 9a00c038ff
commit e8f8e6a279
1 changed files with 11 additions and 1 deletions

View File

@ -73,7 +73,17 @@ public class PathResource extends Resource
if(!URIUtil.equalsIgnoreEncodings(uri,path.toUri()))
{
return Paths.get(uri).toAbsolutePath();
try
{
return Paths.get(uri).toRealPath(FOLLOW_LINKS);
}
catch (IOException ignored)
{
// If the toRealPath() call fails, then let
// the alias checking routines continue on
// to other techniques.
LOG.ignore(ignored);
}
}
if (!abs.isAbsolute())