/** * Add in fragment descriptors that have already been discovered by MetaInfConfiguration * * @param context the web app context to look in * @param metaData the metadata to populate with fragments * * @throws Exception if unable to find web fragments */ public void addWebFragments (final WebAppContext context, final MetaData metaData) throws Exception { @SuppressWarnings("unchecked") Map<Resource, Resource> frags = (Map<Resource,Resource>)context.getAttribute(FRAGMENT_RESOURCES); if (frags!=null) { for (Resource key : frags.keySet()) { if (key.isDirectory()) //tolerate the case where the library is a directory, not a jar. useful for OSGi for example { metaData.addFragment(key, frags.get(key)); } else //the standard case: a jar most likely inside WEB-INF/lib { metaData.addFragment(key, frags.get(key)); } } } } }
/** * Add in fragment descriptors that have already been discovered by MetaInfConfiguration * * @param context the web app context to look in * @param metaData the metadata to populate with fragments * * @throws Exception if unable to find web fragments */ public void addWebFragments (final WebAppContext context, final MetaData metaData) throws Exception { @SuppressWarnings("unchecked") Map<Resource, Resource> frags = (Map<Resource,Resource>)context.getAttribute(FRAGMENT_RESOURCES); if (frags!=null) { for (Resource key : frags.keySet()) { if (key.isDirectory()) //tolerate the case where the library is a directory, not a jar. useful for OSGi for example { metaData.addFragment(key, frags.get(key)); } else //the standard case: a jar most likely inside WEB-INF/lib { metaData.addFragment(key, frags.get(key)); } } } } }
/** * Look for any web-fragment.xml fragments in META-INF of jars in WEB-INF/lib * * @throws Exception */ public void findWebFragments (final WebAppContext context, final MetaData metaData) throws Exception { @SuppressWarnings("unchecked") List<Resource> frags = (List<Resource>)context.getAttribute(FRAGMENT_RESOURCES); if (frags!=null) { for (Resource frag : frags) { if (frag.isDirectory()) //tolerate the case where the library is a directory, not a jar. useful for OSGi for example { metaData.addFragment(frag, Resource.newResource(frag.getURL()+"/META-INF/web-fragment.xml")); } else //the standard case: a jar most likely inside WEB-INF/lib { metaData.addFragment(frag, Resource.newResource("jar:"+frag.getURL()+"!/META-INF/web-fragment.xml")); } } } } }
/** * Look for any web-fragment.xml fragments in META-INF of jars in WEB-INF/lib * * @throws Exception */ public void findWebFragments (final WebAppContext context, final MetaData metaData) throws Exception { @SuppressWarnings("unchecked") List<Resource> frags = (List<Resource>)context.getAttribute(FRAGMENT_RESOURCES); if (frags!=null) { for (Resource frag : frags) { if (frag.isDirectory()) //tolerate the case where the library is a directory, not a jar. useful for OSGi for example { metaData.addFragment(frag, Resource.newResource(frag.getURL()+"/META-INF/web-fragment.xml")); } else //the standard case: a jar most likely inside WEB-INF/lib { metaData.addFragment(frag, Resource.newResource("jar:"+frag.getURL()+"!/META-INF/web-fragment.xml")); } } } } }
/** * Look for any web-fragment.xml fragments in META-INF of jars in WEB-INF/lib * * @throws Exception */ public void findWebFragments (final WebAppContext context, final MetaData metaData) throws Exception { @SuppressWarnings("unchecked") List<Resource> frags = (List<Resource>)context.getAttribute(FRAGMENT_RESOURCES); if (frags!=null) { for (Resource frag : frags) { if (frag.isDirectory()) //tolerate the case where the library is a directory, not a jar. useful for OSGi for example { metaData.addFragment(frag, Resource.newResource(frag.getURL()+"/META-INF/web-fragment.xml")); } else //the standard case: a jar most likely inside WEB-INF/lib { metaData.addFragment(frag, Resource.newResource("jar:"+frag.getURL()+"!/META-INF/web-fragment.xml")); } } } } }
/** * Look for any web-fragment.xml fragments in META-INF of jars in WEB-INF/lib * * @throws Exception */ public void findWebFragments (final WebAppContext context, final MetaData metaData) throws Exception { @SuppressWarnings("unchecked") List<Resource> frags = (List<Resource>)context.getAttribute(FRAGMENT_RESOURCES); if (frags!=null) { for (Resource frag : frags) { if (frag.isDirectory()) //tolerate the case where the library is a directory, not a jar. useful for OSGi for example { metaData.addFragment(frag, Resource.newResource(frag.getURL()+"/META-INF/web-fragment.xml")); } else //the standard case: a jar most likely inside WEB-INF/lib { metaData.addFragment(frag, Resource.newResource("jar:"+frag.getURL()+"!/META-INF/web-fragment.xml")); } } } } }
context.getMetaData().addFragment(fragmentResource, Resource.newResource(url));
/** * Look for any web-fragment.xml fragments in META-INF of jars in WEB-INF/lib * * @throws Exception */ public void findWebFragments (final WebAppContext context, final MetaData metaData) throws Exception { @SuppressWarnings("unchecked") List<Resource> frags = (List<Resource>)context.getAttribute(FRAGMENT_RESOURCES); if (frags!=null) { for (Resource frag : frags) { if (frag.isDirectory()) //tolerate the case where the library is a directory, not a jar. useful for OSGi for example { metaData.addFragment(frag, Resource.newResource(frag.getURL()+"/META-INF/web-fragment.xml")); } else //the standard case: a jar most likely inside WEB-INF/lib { metaData.addFragment(frag, Resource.newResource("jar:"+frag.getURL()+"!/META-INF/web-fragment.xml")); } } } } }
context.getMetaData().addFragment(fragmentResource, Resource.newResource(resolvedUrl)); } else if (devMode && isWebResourceBase(scanResource)) { for (URL resolvedUrl : morphDevelopmentResource(scanResource)) {
context.getMetaData().addFragment(fragmentResource, Resource.newResource(resolvedUrl)); } else if (devMode && isWebResourceBase(scanResource)) { for(URL resolvedUrl : morphDevelopmentResource(scanResource)) {