Java File Behavior on Jenkins

I am encountering problems on my (Linux) Jenkins server when using the Java Files API.

An integration error that uses JUnit TemporaryFolder. The test executes the following code:

Path expectedPath = tmpFolder.getRoot().toPath().resolve("folder1/folder2");

// create files

assertTrue(Files.exists(expectedPath.resolve("newFile1.txt")));

The test passes locally, and I see in the logs to run Jenkins that it expectedPathcreates successfully, but the "path" to my new file confuses me:

/tmp/junit0219318729037123/folder1\/folder2/newFile1.txt

Why was introduced \/? Is this some kind of quirk of files on Linux or a problem with mine tmpFolder?

+4
source share
1 answer

What about:

Path expectedPath = tmpFolder.getRoot().toPath().resolve("folder1").resolve("folder2");
0
source

All Articles