Check whether File#listFiles() returns null.

The docs say this can happen for a directory if there's an I/O error.
This commit is contained in:
akwizgran
2016-09-27 15:52:57 +01:00
parent eb6189150f
commit 53d0b8b21e
6 changed files with 32 additions and 10 deletions

View File

@@ -20,7 +20,7 @@ public class IoUtils {
}
}
public static void copy(InputStream in, OutputStream out)
public static void copyAndClose(InputStream in, OutputStream out)
throws IOException {
byte[] buf = new byte[4096];
try {