Remove windows line endings when parsing index

This commit is contained in:
Phillip Webb
2020-04-06 21:55:52 -07:00
parent 4b1346f4bf
commit d3c06ee0cf

View File

@@ -44,7 +44,8 @@ class IndexedLayers implements Layers {
private MultiValueMap<String, String> layers = new LinkedMultiValueMap<>();
IndexedLayers(String indexFile) {
String[] lines = Arrays.stream(indexFile.split("\n")).filter(StringUtils::hasText).toArray(String[]::new);
String[] lines = Arrays.stream(indexFile.split("\n")).map((line) -> line.replace("\r", ""))
.filter(StringUtils::hasText).toArray(String[]::new);
String layer = null;
for (String line : lines) {
if (line.startsWith("- ")) {