Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Belle2020-04-21 17:23:40 +0000
committerJan Belle2020-04-21 17:23:40 +0000
commitee82858c0b96598ac48ad4ef4b9d4ff005264bc9 (patch)
tree3f62d795fb7bb18f36aa6f7a213a32b838a89eaa /plugins
parent9ed5eb37500a9270c93d8aa4f0b064e7fb12a941 (diff)
downloadorg.eclipse.etrice-ee82858c0b96598ac48ad4ef4b9d4ff005264bc9.tar.gz
org.eclipse.etrice-ee82858c0b96598ac48ad4ef4b9d4ff005264bc9.tar.xz
org.eclipse.etrice-ee82858c0b96598ac48ad4ef4b9d4ff005264bc9.zip
[generator] Fix uri to file path conversion
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.etrice.generator.base/src/org/eclipse/etrice/generator/base/io/FileSystemModelPath.java7
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();
}

Back to the top