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 013c5b47..b9c39de8 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) { - return this.newInstance(rootDir, this.path, this.autoCreateParent, this.disableRootDirCheck); + this.rootDir = rootDir; + return this; } @Override public FileManager setPath(Path path) { - Path resolvedPath; if (this.disableRootDirCheck) { - resolvedPath = path; + this.path = path; } else { if (path.startsWith(this.rootDir)) { - resolvedPath = path; + this.path = path; } else { throw new IllegalArgumentException("path must be in rootDir"); } } - return this.newInstance(this.rootDir, resolvedPath, this.autoCreateParent, this.disableRootDirCheck); + return this; } @Override