Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private List<String> processAndGetLinesAsList(String string) {
Supplier<Stream<String>> streamSupplier = string::lines;
var isFileOk = streamSupplier.get().allMatch(line -> line.matches(MultipartFileUploadUtils.REGEX_RULES));
return isFileOk ? streamSupplier.get().collect(Collectors.toList()) : new ArrayList<>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment