Currentの確認処理を修正

This commit is contained in:
r-ca 2024-01-08 15:09:17 +09:00
parent ce834a7cfd
commit 1a31d63786
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -100,7 +100,15 @@ public class DocumentProcessorImpl implements DocumentProcessor{
String filename = UUID.randomUUID().toString() + ".png"; // TODO-rca: 拡張子を動的にする String filename = UUID.randomUUID().toString() + ".png"; // TODO-rca: 拡張子を動的にする
// FileManager // FileManager
this.fileManager.autoCreateDir(DEFAULT_SAVE_DIR); if (this.fileManager.getCurrentDir().equals(this.documentRootPath.resolve(DEFAULT_SAVE_DIR))) { // TODO-rca: 効率化
logger.debug("addNewPageToLast", "currentDir is documentRootPath");
} else {
logger.debug("addNewPageToLast", "currentDir is not documentRootPath");
this.fileManager.backRootDir();
this.fileManager.autoCreateDir(DEFAULT_SAVE_DIR);
this.fileManager.changeDir(DEFAULT_SAVE_DIR);
}
logger.debug("addNewPageToLast", "DirInit finished");
// Save file // Save file
this.fileManager.saveBitmapAtCurrent(bitmap, filename); this.fileManager.saveBitmapAtCurrent(bitmap, filename);
@ -114,10 +122,11 @@ public class DocumentProcessorImpl implements DocumentProcessor{
@Override @Override
public void addNewPagesToLast(Bitmap[] bitmaps) { public void addNewPagesToLast(Bitmap[] bitmaps) {
logger.debug("addNewPagesToLast(List)", "called"); logger.debug("addNewPagesToLast", "called");
for(Bitmap bitmap : bitmaps) {
for (Bitmap bitmap : bitmaps) {
addNewPageToLast(bitmap); addNewPageToLast(bitmap);
} // TODO-rca: 保存処理をまとめて行う } // TODO-rca: 効率悪いので改善する
} }
@Override @Override