Fixed a potential cause for too many open files
git-svn-id: https://svn.libreccm.org/ccm/trunk@5027 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
9a1fc8deb6
commit
ab09056709
|
|
@ -33,6 +33,7 @@ import java.io.IOException;
|
|||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
|
@ -144,9 +145,9 @@ public class ThemeFileUtil {
|
|||
final List<Path> eligiablePaths) {
|
||||
|
||||
if (Files.isDirectory(path)) {
|
||||
try {
|
||||
Files
|
||||
.newDirectoryStream(path)
|
||||
try (final DirectoryStream<Path> directoryStream = Files
|
||||
.newDirectoryStream(path)) {
|
||||
directoryStream
|
||||
.forEach(current -> prepareThemeFile(current,
|
||||
eligiablePaths));
|
||||
} catch (IOException ex) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue