Skip to content

Commit

Permalink
Correctly resolve .jar resource mountable file from temp directory (f…
Browse files Browse the repository at this point in the history
…or correct checkMountableFile flag detection on Windows)
  • Loading branch information
bedla committed Jan 27, 2020
1 parent 142e585 commit a5e3c58
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 a5e3c58

Please sign in to comment.