From d5cf2f31d6462f692e595ae1f1494d346654725c Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 9 Jan 2024 12:18:03 +0900 Subject: [PATCH] =?UTF-8?q?resolve=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/one/nem/lacerta/source/file/FileManager.java | 3 ++- .../one/nem/lacerta/source/file/impl/FileManagerImpl.java | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/src/main/java/one/nem/lacerta/source/file/FileManager.java b/source/src/main/java/one/nem/lacerta/source/file/FileManager.java index 4cff1b12..473cbde1 100644 --- a/source/src/main/java/one/nem/lacerta/source/file/FileManager.java +++ b/source/src/main/java/one/nem/lacerta/source/file/FileManager.java @@ -5,6 +5,7 @@ import android.graphics.Bitmap; import org.w3c.dom.Document; import java.io.File; +import java.io.IOException; import java.nio.file.Path; import java.util.List; @@ -26,5 +27,5 @@ public interface FileManager { FileManager setRootDir(Path rootDir); FileManager setPath(Path path); - FileManager resolve(String path); + FileManager resolve(String path) throws IOException; } 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 5a9885a3..ddefaf6b 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 @@ -131,12 +131,13 @@ public class FileManagerImpl implements FileManager { } @Override - public FileManager resolve(String path) { + public FileManager resolve(String path) throws IOException{ try { this.path = resolveStringPath(path); } catch (IOException e) { - e.printStackTrace(); + logger.error("resolve", e.getMessage()); + throw new IOException("Invalid path: " + path); } + return this; } - }