Use Files.readAllLines
This commit is contained in:
parent
2934bb11ea
commit
604acf2509
1 changed files with 1 additions and 4 deletions
|
@ -32,7 +32,6 @@ import java.nio.file.Path;
|
||||||
import java.nio.file.StandardOpenOption;
|
import java.nio.file.StandardOpenOption;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes the README file.
|
* Writes the README file.
|
||||||
|
@ -95,9 +94,7 @@ class ReadmeWriter implements CommandLineRunner {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String readFile(final Path file) throws IOException {
|
private String readFile(final Path file) throws IOException {
|
||||||
try (Stream<String> lines = Files.lines(file, StandardCharsets.UTF_8)) {
|
return String.join(NEWLINE, Files.readAllLines(file, StandardCharsets.UTF_8));
|
||||||
return lines.collect(Collectors.joining(NEWLINE));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue