mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
Revert "Revert "新しいインスタンスを作成するメソッドを作った""
This reverts commit 27aa6a2f15
.
This commit is contained in:
parent
c05d45afdd
commit
1efac1ffb6
|
@ -34,13 +34,21 @@ public class FileManagerImpl implements FileManager {
|
||||||
|
|
||||||
// Injection
|
// Injection
|
||||||
private final LacertaLogger logger;
|
private final LacertaLogger logger;
|
||||||
|
|
||||||
@AssistedInject
|
@AssistedInject
|
||||||
public FileManagerImpl(LacertaLogger logger, @Assisted Path rootDir) {
|
public FileManagerImpl(LacertaLogger logger, @Assisted Path rootDir) {
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
this.rootDir = rootDir;
|
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
|
// Internal
|
||||||
private Path resolveStringPath(String path) throws IOException{
|
private Path resolveStringPath(String path) throws IOException{
|
||||||
String[] pathArray = path.split("/");
|
String[] pathArray = path.split("/");
|
||||||
|
@ -61,6 +69,11 @@ public class FileManagerImpl implements FileManager {
|
||||||
return resolvedPath;
|
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
|
@Override
|
||||||
public File getFileRef() {
|
public File getFileRef() {
|
||||||
if (this.isExist()) {
|
if (this.isExist()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user