All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jetbrains.plugin.structure.jar.DefaultJarFileSystemProvider.kt Maven / Gradle / Ivy

Go to download

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
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy