Skip to content

Commit

Permalink
Trim PEM-encoded text in PemContent.of
Browse files Browse the repository at this point in the history
  • Loading branch information
scottfrederick committed Aug 21, 2024
1 parent a5d13d2 commit a5dd483
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ public final class PemContent {
private final String text;

private PemContent(String text) {
this.text = Arrays.stream(StringUtils.tokenizeToStringArray(text, "\r\n"))
.map(String::trim)
.collect(Collectors.joining("\n"));
this.text = text.lines().map(String::trim).collect(Collectors.joining("\n"));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void ofReturnsContent() {
}

private static String contentFromClasspath(String path) throws IOException {
return new ClassPathResource(path).getContentAsString(StandardCharsets.UTF_8).stripTrailing();
return new ClassPathResource(path).getContentAsString(StandardCharsets.UTF_8).indent(0).stripTrailing();
}

}

0 comments on commit a5dd483

Please sign in to comment.