質問編集履歴

1

ソースコード、発生する例外を追加

2021/08/24 03:27

投稿

zon
zon

スコア13

test CHANGED
File without changes
test CHANGED
@@ -35,3 +35,37 @@
35
35
  疎通確認を非同期で行うという案はありますが、開発に費用が発生するので、できればやりたくありません。
36
36
 
37
37
  良い案ないでしょうか。ご教示よろしくお願いします。
38
+
39
+
40
+
41
+ (8/24追記)
42
+
43
+ ソースコードは、以下になります。
44
+
45
+ for (String FilePath : FilePaths) {
46
+
47
+  File folder = new File(FilePath);
48
+
49
+  File file = new File(FilePath + "\" + job.getid() + ".wav");
50
+
51
+  try (FileOutputStream fileOutputStream = new FileOutputStream(file);) {
52
+
53
+   if (!file.exists()) {
54
+
55
+    folder.mkdirs();
56
+
57
+    file.createNewFile(); }
58
+
59
+   fileOutputStream.write(bytes);
60
+
61
+  } catch (Exception e) {
62
+
63
+   logger.info("Exception:", e);
64
+
65
+   logger.error(messageSource.getMessage("E-VRFS-005", new String[] { "ファイル転送失敗", job.getid() }, Locale.JAPAN)); } }
66
+
67
+
68
+
69
+ 発生する例外は、以下です。
70
+
71
+ java.io.FileNotFoundException