You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
withFileFromClassPath fails when path to classpath resource contains spaces #263
1 error
Caused by: org.testcontainers.containers.ContainerFetchException: Can't get Docker image name from org.testcontainers.images.builder.ImageFromDockerfile@61ae0d43
Caused by: java.lang.RuntimeException: Can't get size from ~/dir%20with%20spaces/your-project/target/test-classes/any_file
Caused by: java.nio.file.NoSuchFileException: ~/dir%20with%20spaces/your-project/target/test-classes/any_file
Issue is related to urlencoded spaces in path (%20) when using
URL resource = ClasspathTrait.class.getClassLoader().getResource(resourcePath);
String resourceFilePath = new File(resource.getFile()).getAbsolutePath();
in default implementation of withFileFromClasspath. Calling .toURI() instead of .getFile() on resource should fix this issue while not breaking anything - I'm using this workaround and seems to be fine. No PR though, sorry, simply no time to do it.
Activity
rnorth commentedon Jan 14, 2017
Hi @lbialy
Thanks for reporting, and sorry for the problem and thorough analysis. We'll try and address soon.
Richard
Ensure that piped streams are closed automatically. This resolves an …
lbialy commentedon Jan 17, 2017
@rnorth I think you wanted to mention #262, not #263 here. Glad to see something found.
Ensure that piped streams are closed automatically. This resolves an …
Introduce an abstraction over files and classpath resources.
Introduce an abstraction over files and classpath resources.
Introduce an abstraction over files and classpath resources.
Update CHANGELOG for 1.2.0 release:
rnorth commentedon Mar 13, 2017
@lbialy this is hopefully fixed now - please could you let me know if you encounter any more issues?
I've been developing under a path containing space for a while, just to make sure 😃
Introduce an abstraction over files and classpath resources.
Introduce an abstraction over files and classpath resources.
Introduce an abstraction over files and classpath resources. (#313)
bsideup commentedon Jun 10, 2017
Hi @lbialy
We released 1.3.0 with a few fixes to file mappings, could you please try it?
Thanks!
lbialy commentedon Jun 14, 2017
I'll try, thanks!
bsideup commentedon Apr 11, 2018
Fixed by #279.