Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eaiman-shoshi/4cca92f5d5861baa23362aa175a56e07 to your computer and use it in GitHub Desktop.
Save eaiman-shoshi/4cca92f5d5861baa23362aa175a56e07 to your computer and use it in GitHub Desktop.
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