From 8c0925a63b2400309349895118108393e62c59e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Austvik?= Date: Sun, 11 Dec 2022 10:10:37 +0100 Subject: [PATCH] Dont set read only temp file (#13905) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because it breaks windows builds Signed-off-by: Jørgen Austvik --- .../nanoleaf/internal/layout/NanoleafLayoutTest.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/bundles/org.openhab.binding.nanoleaf/src/test/java/org/openhab/binding/nanoleaf/internal/layout/NanoleafLayoutTest.java b/bundles/org.openhab.binding.nanoleaf/src/test/java/org/openhab/binding/nanoleaf/internal/layout/NanoleafLayoutTest.java index e77048794..2400808d3 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/test/java/org/openhab/binding/nanoleaf/internal/layout/NanoleafLayoutTest.java +++ b/bundles/org.openhab.binding.nanoleaf/src/test/java/org/openhab/binding/nanoleaf/internal/layout/NanoleafLayoutTest.java @@ -18,11 +18,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.attribute.FileAttribute; -import java.nio.file.attribute.PosixFilePermission; -import java.nio.file.attribute.PosixFilePermissions; import java.util.Collections; -import java.util.Set; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; @@ -66,14 +62,11 @@ public class NanoleafLayoutTest { assertNotNull(result, "Should be able to render the layout: " + fileName); assertTrue(result.length > 0, "Should get content back, but got " + result.length + "bytes"); - Set permissions = PosixFilePermissions.fromString("rw-r--r--"); - FileAttribute> attributes = PosixFilePermissions.asFileAttribute(permissions); - Path outFile = Files.createTempFile(temporaryDirectory, fileName.replace(".json", ""), ".png", attributes); + Path outFile = Files.createTempFile(temporaryDirectory, fileName.replace(".json", ""), ".png"); Files.write(outFile, result); // For inspecting images on own computer - // Path permanentOutFile = Files.createFile(Path.of("/tmp", fileName.replace(".json", "") + ".png"), - // attributes); + // Path permanentOutFile = Files.createFile(Path.of("/tmp", fileName.replace(".json", "") + ".png")); // Files.write(permanentOutFile, result); }