How should you handle a FileSystemAlreadyExistsException
when calling FileSystems.newFileSystem?
One way would be to use the already created FileSystem (getFileSystem
), but then you could run into problems when the original creator closes it while you are still using it.
In case there is no generic answer to this question, then what about ZipFileSystem
s? Let's say I want to create one for a zip file and I do not know and cannot control whether a FileSystem already exists for this specific zip file.
Is there a reliable way to handle a FileSystemAlreadyExistsException
?