From 171c8b380c4989110b784fa30fe355250cda5686 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 13 Jan 2024 15:13:56 +0900 Subject: [PATCH] =?UTF-8?q?=E5=8A=B9=E7=8E=87=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/src/main/java/one/nem/lacerta/model/PublicPath.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/model/src/main/java/one/nem/lacerta/model/PublicPath.java b/model/src/main/java/one/nem/lacerta/model/PublicPath.java index 3181d00e..0da4ce3f 100644 --- a/model/src/main/java/one/nem/lacerta/model/PublicPath.java +++ b/model/src/main/java/one/nem/lacerta/model/PublicPath.java @@ -21,18 +21,22 @@ public class PublicPath { this.path.add(path); } - public PublicPath resolve(String path) { + private void resolveInternal(String path) { if (path.equals("..")) { this.path.remove(this.path.size() - 1); } else { add(path); } + } + + public PublicPath resolve(String path) { + resolveInternal(path); return this; } public PublicPath resolve(List path) { for (String p : path) { - resolve(p); + resolveInternal(p); } return this; }