diff options
author | Jon Marius Venstad <jonmv@gmail.com> | 2022-04-06 19:35:30 +0200 |
---|---|---|
committer | Jon Marius Venstad <jonmv@gmail.com> | 2022-04-06 19:35:30 +0200 |
commit | 039589faf5f989d80b9fec2b28ed955ac6fd86f6 (patch) | |
tree | 45c314cc9ede2d5c26a5d6b4f030ad3db2246a91 /vespajlib | |
parent | ec92b5f8882e400f94b851dffcf0b3511373e890 (diff) |
Use HttpURL.Path for Path.getRest()
Diffstat (limited to 'vespajlib')
-rw-r--r-- | vespajlib/abi-spec.json | 1 | ||||
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/path/Path.java | 5 | ||||
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/text/Text.java | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/vespajlib/abi-spec.json b/vespajlib/abi-spec.json index e69631e8375..642fdd5c16f 100644 --- a/vespajlib/abi-spec.json +++ b/vespajlib/abi-spec.json @@ -583,6 +583,7 @@ "final" ], "methods": [ + "public static com.yahoo.path.Path from(java.util.List)", "public boolean isChildOf(com.yahoo.path.Path)", "public com.yahoo.path.Path append(java.lang.String)", "public com.yahoo.path.Path append(com.yahoo.path.Path)", diff --git a/vespajlib/src/main/java/com/yahoo/path/Path.java b/vespajlib/src/main/java/com/yahoo/path/Path.java index 16370059c8c..737a27c57d8 100644 --- a/vespajlib/src/main/java/com/yahoo/path/Path.java +++ b/vespajlib/src/main/java/com/yahoo/path/Path.java @@ -41,6 +41,11 @@ public final class Path { this.delimiter = delimiter; } + /** Creates a new path with the given segments. */ + public static Path from(List<String> segments) { + return new Path(segments, "/"); + } + /** Returns whether this path is an immediate child of the given path */ public boolean isChildOf(Path parent) { return toString().startsWith(parent.toString()) && this.elements.size() -1 == parent.elements.size(); diff --git a/vespajlib/src/main/java/com/yahoo/text/Text.java b/vespajlib/src/main/java/com/yahoo/text/Text.java index 30eba3ebd65..501ca980187 100644 --- a/vespajlib/src/main/java/com/yahoo/text/Text.java +++ b/vespajlib/src/main/java/com/yahoo/text/Text.java @@ -53,6 +53,7 @@ public final class Text { : isTextCharAboveUsAscii(codepoint); } private static boolean isTextCharAboveUsAscii(int codepoint) { + // TODO jonmv: compute modulo? if (codepoint < 0xFDD0) return true; if (codepoint <= 0xFDDF) return false; if (codepoint < 0x1FFFE) return true; |