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()) {