File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/main/scala/viper/silver/utility Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,28 @@ object Paths {
101101
102102 fs.getPath(entryName)
103103
104+ case " resource" =>
105+ val uriStr = uri.toString
106+ assert(uriStr.startsWith(" resource:/" ), " Resource URL should start with \" resource:/\" " )
107+ val entryName = uriStr.substring(9 )
108+ val fileURI = URI .create(" resource:/" )
109+
110+ var fs : FileSystem = null
111+
112+ try {
113+ fs = FileSystems .newFileSystem(fileURI, Map [String , Object ]().asJava)
114+ openFileSystems = fs +: openFileSystems
115+ } catch {
116+ case _ : java.nio.file.FileSystemAlreadyExistsException =>
117+ fs = FileSystems .getFileSystem(fileURI)
118+ assert(fs.isOpen, " The reused file system is expected to still be open" )
119+ } finally {
120+ assert(fs != null , s " Could not get hold of a file system for $fileURI (from $uriStr) " )
121+ }
122+
123+ fs.getPath(entryName)
124+
125+
104126 case other => sys.error(s " Resource $uri of scheme $other is not supported. " )
105127 }
106128 }
You can’t perform that action at this time.
0 commit comments