From 1efac1ffb69db3229fe4cdf3da6d81b90e9a3db4 Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 9 Jan 2024 15:18:30 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"Revert=20"=E6=96=B0=E3=81=97=E3=81=84?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=B3=E3=82=B9=E3=82=92?= =?UTF-8?q?=E4=BD=9C=E6=88=90=E3=81=99=E3=82=8B=E3=83=A1=E3=82=BD=E3=83=83?= =?UTF-8?q?=E3=83=89=E3=82=92=E4=BD=9C=E3=81=A3=E3=81=9F""?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 27aa6a2f156586baec8cf1303b991234103a1598. --- .../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 109f9d8a..207ac5f5 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()) {