diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2022-03-25 17:16:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-25 17:16:36 +0100 |
commit | fff79ba2b645336c437a1503b854d0b821a6d664 (patch) | |
tree | d79a93478908de6815744db0557f269aa51820c2 /config-lib/src/main/java/com/yahoo/config/FileNode.java | |
parent | f514e98a805a363f2807b9fe6d6bf51534fd5897 (diff) |
Revert "Improve error messages for invalid paths"
Diffstat (limited to 'config-lib/src/main/java/com/yahoo/config/FileNode.java')
-rw-r--r-- | config-lib/src/main/java/com/yahoo/config/FileNode.java | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/config-lib/src/main/java/com/yahoo/config/FileNode.java b/config-lib/src/main/java/com/yahoo/config/FileNode.java index 3bcccb6d6b1..a7c1ebb1488 100644 --- a/config-lib/src/main/java/com/yahoo/config/FileNode.java +++ b/config-lib/src/main/java/com/yahoo/config/FileNode.java @@ -1,8 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.config; -import java.nio.file.Path; - /** * Represents a 'file' in a {@link ConfigInstance}, usually a filename. * @@ -15,13 +13,7 @@ public class FileNode extends LeafNode<FileReference> { public FileNode(String stringVal) { super(true); - Path path = Path.of(ReferenceNode.stripQuotes(stringVal)).normalize(); - if (path.isAbsolute()) - throw new IllegalArgumentException("path must be relative"); - if (path.startsWith("..")) - throw new IllegalArgumentException("'..' not allowed in path"); - - this.value = new FileReference(path.toString()); + this.value = new FileReference(ReferenceNode.stripQuotes(stringVal)); } public FileReference value() { |