@Override
    public boolean nextConfig(long timeout) {
        if (checkReloaded()) {
            // Not supporting changing the payload for jar
            return true;
        }
        if (zipEntry == null) {
            // First time polled
            JarFile jarFile;
            try {
                jarFile = new JarFile(jarName);
            } catch (IOException e) {
                throw new IllegalArgumentException(e);
            }
            zipEntry = getEntry(jarFile, path);
            if (zipEntry == null)
                throw new IllegalArgumentException("Config '" + key.getName() + "' not found in '" + jarName + "!/" + path + "'.");
            T config;
            try {
                ConfigPayload payload = new CfgConfigPayloadBuilder().deserialize(List.of(IOUtils.readAll(new InputStreamReader(jarFile.getInputStream(zipEntry), StandardCharsets.UTF_8)).split("\n")));
                config = payload.toInstance(configClass, key.getConfigId());
            } catch (UnsupportedEncodingException e) {
                throw new IllegalStateException(e);
            } catch (IOException e) {
                throw new ConfigurationRuntimeException(e);
            }
            setConfig(0L, false, config, PayloadChecksums.empty());
            try {
                jarFile.close();
            } catch (IOException e) {
                throw new ConfigurationRuntimeException(e);
            }
            return true;
        }
        // TODO: Should wait and detect changes
        try {
            Thread.sleep(timeout);
        } catch (InterruptedException e) {
            throw new ConfigInterruptedException(e);
        }
        return false;
    }
Subscription to use when config id is jar:.../foo.jar[!/pathInJar/]

@author Vegard Havdal
@author gjoranv
config/src/main/java/com/yahoo/config/subscription/impl/JarConfigSubscription.java