private static JarURLConnection openJarUrlConnection(final Path jarPath) throws InvalidJarPluginException {
        // jar:file:/...
        final URL jarUrl;
        try {
            jarUrl = new URL("jar:" + jarPath.toUri().toURL().toString() + "!/");
        } catch (MalformedURLException ex) {
            throw new InvalidJarPluginException("JAR plugin path specified is invalid: " + jarPath.toString(), ex);
        }

        try {
            return (JarURLConnection) jarUrl.openConnection();
        } catch (IOException ex) {
            throw new InvalidJarPluginException("JAR plugin specified is formatted wrongly: " + jarPath.toString(), ex);
        }
    }
Opens JarURLConnection for the given JAR file path.

Note that JarURLConnection does not have {@code disconnect} nor {@code close}.
embulk-core/src/main/java/org/embulk/plugin/jar/JarPluginLoader.java