From b0c97da38271a56f216f88060b80fde4bb4d1cea Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 9 Jan 2024 12:52:18 +0900 Subject: [PATCH] =?UTF-8?q?createFile=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/source/file/impl/FileManagerImpl.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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 b7c46d78..5a59a4d1 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 @@ -167,12 +167,19 @@ public class FileManagerImpl implements FileManager { @Override public FileManager createFile() throws IOException { - return null; + try { + Files.createFile(this.path); + } catch (Exception e) { + logger.error("createFile", e.getMessage()); + throw new IOException("Failed to create file"); + } + return this; } @Override - public FileManager createFile(String fileName) throws IOException { - return null; + public FileManager createFile(String fileName) throws IOException { // pathが書き換わってしまうのは想像できない挙動かも? + this.resolve(fileName); + return this.createFile(); } @Override