com.jetbrains.plugin.structure.jar.DefaultJarFileSystemProvider.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of structure-base Show documentation
Show all versions of structure-base Show documentation
Base library for parsing JetBrains plugins. Used by other JetBrains Plugins structure libraries.
The newest version!
package com.jetbrains.plugin.structure.jar
import java.nio.file.FileSystem
import java.nio.file.FileSystems
import java.nio.file.Path
/**
* Provider that always returns a new instance of filesystem.
* @see [FileSystems#newFileSystem]
*/
class DefaultJarFileSystemProvider : JarFileSystemProvider {
@Throws(JarArchiveCannotBeOpenException::class)
override fun getFileSystem(jarPath: Path): FileSystem {
return try {
FileSystems.newFileSystem(jarPath, PluginJar::class.java.classLoader)
} catch (e: Throwable) {
throw JarArchiveCannotBeOpenException(jarPath, e)
}
}
override fun close(jarPath: Path) {
// do nothing
}
}