From 2e9adb94ec09c074c43984e14e710daf9d1d6c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivo=20=C5=A0m=C3=ADd?= Date: Sun, 9 Feb 2020 20:34:02 +0100 Subject: [PATCH] checkMountableFile on Windows (#2296) --- .../java/org/testcontainers/utility/MountableFile.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/testcontainers/utility/MountableFile.java b/core/src/main/java/org/testcontainers/utility/MountableFile.java index 22939b0e1fd..7b7367b9290 100644 --- a/core/src/main/java/org/testcontainers/utility/MountableFile.java +++ b/core/src/main/java/org/testcontainers/utility/MountableFile.java @@ -242,7 +242,11 @@ private String extractClassPathResourceToTempLocation(final String hostPath) { // Mark temporary files/dirs for deletion at JVM shutdown deleteOnExit(tmpLocation.toPath()); - return tmpLocation.getAbsolutePath(); + try { + return tmpLocation.getCanonicalPath(); + } catch (IOException e) { + throw new IllegalStateException(e); + } } private File createTempDirectory() { @@ -371,8 +375,8 @@ public static int getUnixFileMode(final Path path) { try { int unixMode = (int) Files.readAttributes(path, "unix:mode").get("mode"); // Truncate mode bits for z/OS - if ("OS/390".equals(SystemUtils.OS_NAME) || - "z/OS".equals(SystemUtils.OS_NAME) || + if ("OS/390".equals(SystemUtils.OS_NAME) || + "z/OS".equals(SystemUtils.OS_NAME) || "zOS".equals(SystemUtils.OS_NAME) ) { unixMode &= TarConstants.MAXID; unixMode |= Files.isDirectory(path) ? 040000 : 0100000;