@@ -94,7 +94,7 @@ void deleteFiles() throws IOException {
9494 void refusesToWriteThroughASymlinkPlantedAtTheDestination (@ TempDir Path tempDir ) throws Exception {
9595 Path insideDirectory = Files .createDirectories (tempDir .resolve ("temp" ));
9696 Path outsideTarget = tempDir .resolve ("escaped.txt" );
97- Files . writeString (outsideTarget , "original" );
97+ FileUtils . writeStringToFile (outsideTarget . toFile () , "original" , StandardCharsets . UTF_8 );
9898 Path plantedLink = insideDirectory .resolve ("Temp_1_lecture.pdf" );
9999 try {
100100 Files .createSymbolicLink (plantedLink , outsideTarget );
@@ -154,7 +154,7 @@ public int read() throws IOException {
154154 @ Test
155155 void keepsAnExistingFileWhenTheOpenIsRefused (@ TempDir Path tempDir ) throws Exception {
156156 Path target = tempDir .resolve ("existing.txt" );
157- Files . writeString (target , "original" );
157+ FileUtils . writeStringToFile (target . toFile () , "original" , StandardCharsets . UTF_8 );
158158
159159 try (InputStream inputStream = new ByteArrayInputStream ("replacement" .getBytes (StandardCharsets .UTF_8 ))) {
160160 assertThatThrownBy (() -> FileUtil .writeNewFileElseThrow (inputStream , target )).isInstanceOf (FileAlreadyExistsException .class );
@@ -166,7 +166,7 @@ void keepsAnExistingFileWhenTheOpenIsRefused(@TempDir Path tempDir) throws Excep
166166 @ Test
167167 void refusesToOverwriteAnExistingFile (@ TempDir Path tempDir ) throws Exception {
168168 Path target = tempDir .resolve ("file.txt" );
169- Files . writeString (target , "original" );
169+ FileUtils . writeStringToFile (target . toFile () , "original" , StandardCharsets . UTF_8 );
170170
171171 try (InputStream inputStream = new ByteArrayInputStream ("replacement" .getBytes (StandardCharsets .UTF_8 ))) {
172172 assertThatThrownBy (() -> FileUtil .writeNewFileElseThrow (inputStream , target )).isInstanceOf (FileAlreadyExistsException .class );
0 commit comments