diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-16 12:43:57 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-10-16 12:50:50 +0200 |
commit | 6f69781df0a1bc5809bf8acad84e2bab01429ce9 (patch) | |
tree | 36c60b2a36e72e956e2a6458d09b41eefc2f08af /qadevOOo | |
parent | a2fa0ded8acb4e6c6e48f40b8ebe99aafe0f9899 (diff) |
cid#1326952 RV: Bad use of return value
Change-Id: I93794f661d28b982baf0dbba1ddc9b07d6ce81ff
Diffstat (limited to 'qadevOOo')
-rw-r--r-- | qadevOOo/runner/helper/FileTools.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/qadevOOo/runner/helper/FileTools.java b/qadevOOo/runner/helper/FileTools.java index 4bcee70a52ce..f8708e55817d 100644 --- a/qadevOOo/runner/helper/FileTools.java +++ b/qadevOOo/runner/helper/FileTools.java @@ -33,8 +33,8 @@ public class FileTools { * Copies all files under srcDir to dstDir. * If dstDir does not exist, it will be created. * @param srcDir the source directory - * @param dstDir the destination direcotry - * @throws java.io.IOException throws java.io.IOException if something failes + * @param dstDir the destination directory + * @throws java.io.IOException throws java.io.IOException if something fails */ public static void copyDirectory(File srcDir, File dstDir) throws java.io.IOException { @@ -45,9 +45,9 @@ public class FileTools { * ignore list. This files will not be copied. * If dstDir does not exist, it will be created. * @param srcDir the source directory - * @param dstDir the destination direcotry + * @param dstDir the destination directory * @param ignore a list of files which should not be copied - * @throws java.io.IOException throws java.io.IOException if something failes + * @throws java.io.IOException throws java.io.IOException if something fails */ public static void copyDirectory(File srcDir, File dstDir, String[] ignore) throws java.io.IOException { @@ -60,7 +60,9 @@ public class FileTools { if (srcDir.isDirectory()) { if (!dstDir.exists()) { - dstDir.mkdir(); + if (!dstDir.mkdir()) { + throw new java.io.IOException("could not create folder " + dstDir); + } } String[] files = srcDir.list(); @@ -77,7 +79,7 @@ public class FileTools { * Copies src file to dst file. If the dst file does not exist, it is created * @param src the source file * @param dst the destination file - * @throws java.io.IOException throws java.io.IOException if something failes + * @throws java.io.IOException throws java.io.IOException if something fails */ public static void copyFile(File src, File dst) throws java.io.IOException { InputStream in = null; |