Sonar qube is giving me the following error
Use try-with-resources or close this "Stream" in a "finally" clause
List<Path> paths = find(Paths.get(nasProps.getUpstreamOutputDirectory() + File.separator + inputSource.concat("_").concat(contentGroup).concat("_").concat(parentId)), MAX_VALUE, (filePath, fileAttr) -> fileAttr.isRegularFile() && filePath.getFileName().toString().matches(".*\\." + extTxt)) .collect(toList()); paths.stream().forEach(path -> textFileQueue.add(path)); I dont have much understanding of java8. could you please help me to close the stream