Revert "Polish"

This reverts commit 6a65ca13ea since
FileCopyUtils will close the reader/writer.
3.1.x
Phillip Webb 1 year ago
parent 848a61a3a8
commit 2fdc29b885

@ -83,14 +83,9 @@ public abstract class AbstractDockerComposeIntegrationTests {
private File transformedComposeFile(File composeFile, DockerImageName imageName) { private File transformedComposeFile(File composeFile, DockerImageName imageName) {
File tempComposeFile = Path.of(tempDir.toString(), composeFile.getName()).toFile(); File tempComposeFile = Path.of(tempDir.toString(), composeFile.getName()).toFile();
try { try {
String composeFileContent; String composeFileContent = FileCopyUtils.copyToString(new FileReader(composeFile));
try (FileReader reader = new FileReader(composeFile)) {
composeFileContent = FileCopyUtils.copyToString(reader);
}
composeFileContent = composeFileContent.replace("{imageName}", imageName.asCanonicalNameString()); composeFileContent = composeFileContent.replace("{imageName}", imageName.asCanonicalNameString());
try (FileWriter writer = new FileWriter(tempComposeFile)) { FileCopyUtils.copy(composeFileContent, new FileWriter(tempComposeFile));
FileCopyUtils.copy(composeFileContent, writer);
}
} }
catch (IOException ex) { catch (IOException ex) {
fail("Error transforming Docker compose file '" + composeFile + "' to '" + tempComposeFile + "': " fail("Error transforming Docker compose file '" + composeFile + "' to '" + tempComposeFile + "': "

Loading…
Cancel
Save