org.eclipse.jetty.webapp.MetaData.addFragment()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中org.eclipse.jetty.webapp.MetaData.addFragment()方法的一些代码示例,展示了MetaData.addFragment()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MetaData.addFragment()方法的具体详情如下:
包路径:org.eclipse.jetty.webapp.MetaData
类名称:MetaData
方法名:addFragment

MetaData.addFragment介绍

[英]Add a web-fragment.xml
[中]添加一个网页片段。xml

代码示例

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

/**
   * 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));
        }
      }
    }
  }
}

代码示例来源:origin: jenkinsci/winstone

/**
   * 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));
        }
      }
    }
  }
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
   * 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"));
        }
      }
    }
  }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

/**
   * 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"));
        }
      }
    }
  }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

/**
   * 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"));
        }
      }
    }
  }
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

/**
   * 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"));
        }
      }
    }
  }
}

代码示例来源:origin: cd.connect.common/connect-runnable-war

context.getMetaData().addFragment(fragmentResource, Resource.newResource(url));

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

/**
   * 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"));
        }
      }
    }
  }
}

代码示例来源:origin: cd.connect.common/connect-runnable-war

context.getMetaData().addFragment(fragmentResource, Resource.newResource(resolvedUrl));
} else if (devMode && isWebResourceBase(scanResource)) {
  for (URL resolvedUrl : morphDevelopmentResource(scanResource)) {

代码示例来源:origin: works.lmz.common/common-runnable-war

context.getMetaData().addFragment(fragmentResource, Resource.newResource(resolvedUrl));
} else if (devMode && isWebResourceBase(scanResource)) {
  for(URL resolvedUrl : morphDevelopmentResource(scanResource)) {

相关文章

微信公众号

最新文章

更多