URI to file in Zip incorrect if path contains spaces
问题 I want to get the URIs to the entries of a zip file in order to keep references to it's contents without having to keep the zip file open. Therefore I open the zip file using the zip filesystem and export the Path of the entries as URI. Path zipfile = ... URI uriOfFileInZip; try(FileSystem fs = FileSystems.newFileSystem(zipfile, null)){ Path fileInZip = fs.getPath("fileInZip.txt"); uriOfFileInZip = fileInZip.toUri(); } Now I want to read the file again, so I try to open a stream to the file.