Fixed a potential cause for too many open files

git-svn-id: https://svn.libreccm.org/ccm/trunk@5027 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2017-10-05 12:33:39 +00:00
parent 9a1fc8deb6
commit ab09056709
1 changed files with 4 additions and 3 deletions

View File

@ -33,6 +33,7 @@ import java.io.IOException;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.nio.file.DirectoryStream;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
@ -144,9 +145,9 @@ public class ThemeFileUtil {
final List<Path> eligiablePaths) { final List<Path> eligiablePaths) {
if (Files.isDirectory(path)) { if (Files.isDirectory(path)) {
try { try (final DirectoryStream<Path> directoryStream = Files
Files .newDirectoryStream(path)) {
.newDirectoryStream(path) directoryStream
.forEach(current -> prepareThemeFile(current, .forEach(current -> prepareThemeFile(current,
eligiablePaths)); eligiablePaths));
} catch (IOException ex) { } catch (IOException ex) {