diff options
author | Jan Belle | 2020-04-21 17:23:40 +0000 |
---|---|---|
committer | Jan Belle | 2020-04-21 17:23:40 +0000 |
commit | ee82858c0b96598ac48ad4ef4b9d4ff005264bc9 (patch) | |
tree | 3f62d795fb7bb18f36aa6f7a213a32b838a89eaa /plugins | |
parent | 9ed5eb37500a9270c93d8aa4f0b064e7fb12a941 (diff) | |
download | org.eclipse.etrice-ee82858c0b96598ac48ad4ef4b9d4ff005264bc9.tar.gz org.eclipse.etrice-ee82858c0b96598ac48ad4ef4b9d4ff005264bc9.tar.xz org.eclipse.etrice-ee82858c0b96598ac48ad4ef4b9d4ff005264bc9.zip |
[generator] Fix uri to file path conversion
Change-Id: I62838e6fe50934ecaea4e53d03b29276dca2f0d3
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/org.eclipse.etrice.generator.base/src/org/eclipse/etrice/generator/base/io/FileSystemModelPath.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/org.eclipse.etrice.generator.base/src/org/eclipse/etrice/generator/base/io/FileSystemModelPath.java b/plugins/org.eclipse.etrice.generator.base/src/org/eclipse/etrice/generator/base/io/FileSystemModelPath.java index c1e9def7e..42705cf10 100644 --- a/plugins/org.eclipse.etrice.generator.base/src/org/eclipse/etrice/generator/base/io/FileSystemModelPath.java +++ b/plugins/org.eclipse.etrice.generator.base/src/org/eclipse/etrice/generator/base/io/FileSystemModelPath.java @@ -180,10 +180,11 @@ public class FileSystemModelPath implements IModelPath { if(uri.isFile()) { /* * If the authority of the uri is non-empty, - * URI.toFileString produces an invalid file string that can't be parsed by Paths.get. - * So we create the path directly from the device and segments of the uri. + * URI.toFileString produces a file string containing the authority that can't be parsed by Paths.get. + * So we create the path directly from the device and segments of the uri and convert it to an absolute path if necessary. */ - return Optional.of(Paths.get(uri.hasDevice() ? uri.device() : "", uri.segments())); + Path path = Paths.get(uri.hasDevice() ? uri.device() : "", uri.segments()); + return Optional.of(uri.hasAbsolutePath() ? path.toAbsolutePath() : path); } return Optional.empty(); } |