mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-15 01:07:30 +08:00
Revert "Polish"
This reverts commit 6a65ca13ea
since
FileCopyUtils will close the reader/writer.
This commit is contained in:
parent
848a61a3a8
commit
2fdc29b885
@ -83,14 +83,9 @@ public abstract class AbstractDockerComposeIntegrationTests {
|
||||
private File transformedComposeFile(File composeFile, DockerImageName imageName) {
|
||||
File tempComposeFile = Path.of(tempDir.toString(), composeFile.getName()).toFile();
|
||||
try {
|
||||
String composeFileContent;
|
||||
try (FileReader reader = new FileReader(composeFile)) {
|
||||
composeFileContent = FileCopyUtils.copyToString(reader);
|
||||
}
|
||||
String composeFileContent = FileCopyUtils.copyToString(new FileReader(composeFile));
|
||||
composeFileContent = composeFileContent.replace("{imageName}", imageName.asCanonicalNameString());
|
||||
try (FileWriter writer = new FileWriter(tempComposeFile)) {
|
||||
FileCopyUtils.copy(composeFileContent, writer);
|
||||
}
|
||||
FileCopyUtils.copy(composeFileContent, new FileWriter(tempComposeFile));
|
||||
}
|
||||
catch (IOException ex) {
|
||||
fail("Error transforming Docker compose file '" + composeFile + "' to '" + tempComposeFile + "': "
|
||||
|
Loading…
Reference in New Issue
Block a user