From 65a25ad2282e34c8cd77a6af0fcb1971a77f1c99 Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 9 Jan 2024 15:18:31 +0900 Subject: [PATCH] Revert "Revert "WIP"" This reverts commit 1b676f83681f69cf322faecdf3806d82ad0ef05f. --- .../nem/lacerta/source/file/impl/FileManagerImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java b/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java index 207ac5f5..66b60886 100644 --- a/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java +++ b/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java @@ -153,22 +153,22 @@ public class FileManagerImpl implements FileManager { @Override public FileManager setRootDir(Path rootDir) { - this.rootDir = rootDir; - return this; + return this.newInstance(rootDir, this.path, this.autoCreateParent, this.disableRootDirCheck); } @Override public FileManager setPath(Path path) { + Path resolvedPath; if (this.disableRootDirCheck) { - this.path = path; + resolvedPath = path; } else { if (path.startsWith(this.rootDir)) { - this.path = path; + resolvedPath = path; } else { throw new IllegalArgumentException("path must be in rootDir"); } } - return this; + return this.newInstance(this.rootDir, resolvedPath, this.autoCreateParent, this.disableRootDirCheck); } @Override