Search in sources :

Example 1 with Revision

use of org.apache.felix.connect.Revision in project jackrabbit-oak by apache.

the class SpringBootSupport method processDescriptors.

public static List<BundleDescriptor> processDescriptors(List<BundleDescriptor> descriptors) throws IOException {
    List<BundleDescriptor> processed = Lists.newArrayList();
    for (BundleDescriptor desc : descriptors) {
        if (desc.getRevision() == null) {
            URL u = new URL(desc.getUrl());
            URLConnection uc = u.openConnection();
            if (uc instanceof JarURLConnection && uc.getClass().getName().startsWith(SPRING_BOOT_PACKAGE)) {
                Revision rev = new SpringBootJarRevision(((JarURLConnection) uc).getJarFile(), uc.getLastModified());
                desc = new BundleDescriptor(desc.getClassLoader(), desc.getUrl(), desc.getHeaders(), rev, desc.getServices());
            }
        }
        processed.add(desc);
    }
    return processed;
}
Also used : BundleDescriptor(org.apache.felix.connect.launch.BundleDescriptor) Revision(org.apache.felix.connect.Revision) JarURLConnection(java.net.JarURLConnection) URL(java.net.URL) URLConnection(java.net.URLConnection) JarURLConnection(java.net.JarURLConnection)

Aggregations

JarURLConnection (java.net.JarURLConnection)1 URL (java.net.URL)1 URLConnection (java.net.URLConnection)1 Revision (org.apache.felix.connect.Revision)1 BundleDescriptor (org.apache.felix.connect.launch.BundleDescriptor)1