org.linkedin.util-core/src/main/java/org/linkedin/util/io/resource/ResourceChain.java
public static Resource create(List<Resource> resources)
  {
    if(resources.size() == 1)
      return resources.get(0).chroot(".");

    List<InternalResourceProvider> providers =
      new ArrayList<InternalResourceProvider>(resources.size());

    for(Resource resource : resources)
    {
      resource = resource.chroot(".");
      
      InternalResourceProvider provider =
        (InternalResourceProvider) ((InternalResource) resource).getResourceProvider();

      if(provider instanceof ResourceProviderChain)
      {
        ResourceProviderChain resourceProviderChain = (ResourceProviderChain) provider;
        providers.addAll(resourceProviderChain.getResourceProviders());
      }
      else
      {
        providers.add(provider);
      }
    }

    return new ResourceProviderChain(providers).getRootResource();
  }
public static Resource create(List<Resource> resources)
  {
    if(resources.size() == 1)
      return resources.get(0).chroot(".");

    List<InternalResourceProvider> providers =
      new ArrayList<InternalResourceProvider>(resources.size());

    for(Resource resource : resources)
    {
      resource = resource.chroot(".");
      
      InternalResourceProvider provider =
        (InternalResourceProvider) ((InternalResource) resource).getResourceProvider();

      if(provider instanceof ResourceProviderChain)
      {
        ResourceProviderChain resourceProviderChain = (ResourceProviderChain) provider;
        providers.addAll(resourceProviderChain.getResourceProviders());
      }
      else
      {
        providers.add(provider);
      }
    }

    return new ResourceProviderChain(providers).getRootResource();
  }
Convenient method to create a chain from a list of resources. All the resources are turned into
roots before chaining (otherwise it does not make a lot of sense...)

@param resources the list of resources.
@return the resource