Created
March 30, 2017 13:25
-
-
Save blackdev1l/5d910ee639341308fc687a42c16b8d6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Optional<File[]> files = Optional.ofNullable(new File(staticFolder).listFiles()); | |
return files.map(logos -> Arrays.stream(logos) | |
.filter(file -> file.getName().matches(".+(png|jpg|gif)")) | |
.findFirst() | |
.map(filename -> String.format("%s/%s/logo/%s", staticUrl, division, filename)) | |
.orElse("")) | |
.orElse(""); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment