Skip to content

Commit

Permalink
checkMountableFile on Windows (testcontainers#2296)
Browse files Browse the repository at this point in the history
  • Loading branch information
bedla authored and quincy committed May 28, 2020
1 parent 62a4583 commit 46e502d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/src/main/java/org/testcontainers/utility/MountableFile.java
Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 46e502d

Please sign in to comment.