464869 PathResource.addPath allows absolute resolution.

More efficient addPath
This commit is contained in:
Greg Wilkins 2015-04-20 11:50:19 +10:00
parent 12a9c0578e
commit 6b359b942a
1 changed files with 2 additions and 5 deletions

View File

@ -204,12 +204,9 @@ public class PathResource extends Resource
// subpaths are always under PathResource
// compensate for input subpaths like "/subdir"
// where default java.nio.file behavior would be
// where default resolve behavior would be
// to treat that like an absolute path
StringBuilder relpath = new StringBuilder();
relpath.append(".").append(File.separator);
relpath.append(cpath);
return new PathResource(this.path.resolve(relpath.toString()).normalize());
return new PathResource(this.path.getFileSystem().getPath(path.toString(), subpath));
}
@Override