mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
Initを廃止
This commit is contained in:
parent
de85626d66
commit
98c3820679
|
@ -21,6 +21,4 @@ public interface DocumentProcessor {
|
||||||
int getPageCount();
|
int getPageCount();
|
||||||
|
|
||||||
DocumentDetail getDocumentDetail();
|
DocumentDetail getDocumentDetail();
|
||||||
void init() throws Exception; // TODO-rca: 例外処理
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,8 @@ import one.nem.lacerta.utils.LacertaLogger;
|
||||||
|
|
||||||
import one.nem.lacerta.utils.XmlMetaParser;
|
import one.nem.lacerta.utils.XmlMetaParser;
|
||||||
import one.nem.lacerta.utils.repository.DeviceInfoUtils;
|
import one.nem.lacerta.utils.repository.DeviceInfoUtils;
|
||||||
|
import one.nem.lacerta.vcs.LacertaVcs;
|
||||||
|
import one.nem.lacerta.vcs.factory.LacertaVcsFactory;
|
||||||
|
|
||||||
|
|
||||||
public class DocumentProcessorImpl implements DocumentProcessor{
|
public class DocumentProcessorImpl implements DocumentProcessor{
|
||||||
|
@ -36,38 +38,34 @@ public class DocumentProcessorImpl implements DocumentProcessor{
|
||||||
private XmlMetaModel xmlMetaModel;
|
private XmlMetaModel xmlMetaModel;
|
||||||
private Path documentRootPath;
|
private Path documentRootPath;
|
||||||
private FileManager fileManager;
|
private FileManager fileManager;
|
||||||
|
private LacertaVcs lacertaVcs;
|
||||||
|
|
||||||
// Injection
|
// Injection
|
||||||
private final FileManagerFactory fileManagerFactory;
|
private final FileManagerFactory fileManagerFactory;
|
||||||
private final LacertaLogger logger;
|
private final LacertaLogger logger;
|
||||||
private final XmlMetaParser xmlMetaParser;
|
private final XmlMetaParser xmlMetaParser;
|
||||||
|
private final LacertaVcsFactory lacertaVcsFactory;
|
||||||
private final DeviceInfoUtils deviceInfoUtils;
|
private final DeviceInfoUtils deviceInfoUtils;
|
||||||
@AssistedInject
|
@AssistedInject
|
||||||
public DocumentProcessorImpl(FileManagerFactory fileManagerFactory, LacertaLogger logger, XmlMetaParser xmlMetaParser, DeviceInfoUtils deviceInfoUtils, @Assisted DocumentDetail documentDetail) {
|
public DocumentProcessorImpl(FileManagerFactory fileManagerFactory, LacertaLogger logger, XmlMetaParser xmlMetaParser, LacertaVcsFactory lacertaVcsFactory, DeviceInfoUtils deviceInfoUtils, @Assisted DocumentDetail documentDetail) {
|
||||||
this.fileManagerFactory = fileManagerFactory;
|
this.fileManagerFactory = fileManagerFactory;
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
this.xmlMetaParser = xmlMetaParser;
|
this.xmlMetaParser = xmlMetaParser;
|
||||||
if (documentDetail == null) {
|
if (documentDetail == null) {
|
||||||
throw new IllegalArgumentException("documentDetail must not be null");
|
throw new IllegalArgumentException("documentDetail must not be null");
|
||||||
}
|
}
|
||||||
|
this.lacertaVcsFactory = lacertaVcsFactory;
|
||||||
this.documentDetail = documentDetail;
|
this.documentDetail = documentDetail;
|
||||||
this.deviceInfoUtils = deviceInfoUtils;
|
this.deviceInfoUtils = deviceInfoUtils;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
// Init
|
||||||
public void init() throws Exception{
|
|
||||||
logger.debug("init", "called");
|
|
||||||
// Init Variables
|
|
||||||
this.documentRootPath = deviceInfoUtils.getExternalStorageDirectory().resolve(this.documentDetail.getMeta().getId());
|
this.documentRootPath = deviceInfoUtils.getExternalStorageDirectory().resolve(this.documentDetail.getMeta().getId());
|
||||||
logger.debug("init", "documentRootPath: " + this.documentRootPath);
|
logger.debug("init", "documentRootPath: " + this.documentRootPath);
|
||||||
|
|
||||||
this.fileManager = fileManagerFactory.create(this.documentRootPath).enableAutoCreateParent(); //Initialize FileManager
|
this.fileManager = fileManagerFactory.create(this.documentRootPath).enableAutoCreateParent(); //Initialize FileManager
|
||||||
|
this.lacertaVcs = lacertaVcsFactory.create(this.documentDetail.getMeta().getId());
|
||||||
|
|
||||||
logger.debug("init", "fileManager created");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addNewPageToLast(Bitmap bitmap) throws Exception{
|
public void addNewPageToLast(Bitmap bitmap) throws Exception{
|
||||||
logger.debug("addNewPageToLast", "called");
|
logger.debug("addNewPageToLast", "called");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user