From 943ca1daf58dd33a994e007aa49260240e42a7e4 Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 9 Jan 2024 15:05:28 +0900 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E3=81=97=E3=81=84=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=82=BF=E3=83=B3=E3=82=B9=E3=82=92=E4=BD=9C=E6=88=90?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E3=82=92?= =?UTF-8?q?=E4=BD=9C=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/source/file/impl/FileManagerImpl.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 ed011f9c..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 @@ -34,13 +34,21 @@ public class FileManagerImpl implements FileManager { // Injection private final LacertaLogger logger; - @AssistedInject public FileManagerImpl(LacertaLogger logger, @Assisted Path rootDir) { this.logger = logger; this.rootDir = rootDir; } + // for generate new instance + public FileManagerImpl(LacertaLogger logger, Path rootDir, Path path, boolean autoCreateParent, boolean disableRootDirCheck) { + this.logger = logger; + this.rootDir = rootDir; + this.path = path; + this.autoCreateParent = autoCreateParent; + this.disableRootDirCheck = disableRootDirCheck; + } + // Internal private Path resolveStringPath(String path) throws IOException{ String[] pathArray = path.split("/"); @@ -61,6 +69,11 @@ public class FileManagerImpl implements FileManager { return resolvedPath; } + private FileManager newInstance(Path rootDir, Path path, boolean autoCreateParent, boolean disableRootDirCheck) { + logger.debug("newInstance", "Generating new instance"); + return new FileManagerImpl(this.logger, rootDir, path, autoCreateParent, disableRootDirCheck); + } + @Override public File getFileRef() { if (this.isExist()) {