[weld-commits] Weld SVN: r6087 - in extensions/trunk: src/main/java/org/jboss/weld/extensions/resources and 1 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Fri Apr 9 17:34:17 EDT 2010


Author: swd847
Date: 2010-04-09 17:34:16 -0400 (Fri, 09 Apr 2010)
New Revision: 6087

Removed:
   extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/servlet/
Modified:
   extensions/trunk/pom.xml
   extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java
Log:
removed servlet stuff


Modified: extensions/trunk/pom.xml
===================================================================
--- extensions/trunk/pom.xml	2010-04-09 20:48:36 UTC (rev 6086)
+++ extensions/trunk/pom.xml	2010-04-09 21:34:16 UTC (rev 6087)
@@ -156,12 +156,6 @@
       </dependency>
       
       <dependency>
-         <groupId>javax.servlet</groupId>
-         <artifactId>servlet-api</artifactId>
-         <optional>true</optional>
-      </dependency>
-
-      <dependency>
          <groupId>javax.enterprise</groupId>
          <artifactId>cdi-api</artifactId>
          <scope>provided</scope>

Modified: extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java
===================================================================
--- extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java	2010-04-09 20:48:36 UTC (rev 6086)
+++ extensions/trunk/src/main/java/org/jboss/weld/extensions/resources/spi/ResourceLoaderImpl.java	2010-04-09 21:34:16 UTC (rev 6087)
@@ -2,32 +2,20 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Enumeration;
 import java.util.HashSet;
 import java.util.Set;
 
-import javax.inject.Inject;
-import javax.servlet.ServletContext;
-
 import org.jboss.weld.extensions.resources.ResourceProducer;
-import org.jboss.weld.extensions.resources.servlet.ServletResourceExtension;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class ResourceLoaderImpl implements ResourceLoader
 {
 
-   private final Set<ServletContext> servletContexts;
-
    private static final Logger log = LoggerFactory.getLogger("org.jboss.weld.extensions.resources");
    
-   @Inject
-   private ResourceLoaderImpl(ServletResourceExtension extension)
-   {
-      servletContexts = extension.getServletContexts();
-   }
 
    public InputStream getResourceAsStream(String name)
    {
@@ -53,16 +41,6 @@
             return stream;
          }
       }
-      String slashedName = getSlashedName(name);
-      for (ServletContext context : servletContexts)
-      {
-         InputStream stream = context.getResourceAsStream(slashedName);
-         if (stream != null)
-         {
-            log.trace("Loaded resource from ServletContext: " + slashedName);
-            return stream;
-         }
-      }
       return null;
    }
 
@@ -90,24 +68,6 @@
             return url;
          }
       }
-      String slashedName = getSlashedName(name);
-      // Try to load from the ServletContext
-      for (ServletContext context : servletContexts)
-      {
-         try
-         {
-            URL url = context.getResource(slashedName);
-            if (url != null)
-            {
-               log.trace("Loaded resource from ServletContext: " + slashedName);
-               return url;
-            }
-         }
-         catch (MalformedURLException e)
-         {
-            log.error("Malformed URL loading " + name, e);
-         }
-      }
       return null;
    }
    
@@ -150,22 +110,6 @@
             throw new RuntimeException(e);
          }
       }
-      String slashedName = getSlashedName(name);
-      for (ServletContext context : servletContexts)
-      {
-         try
-         {
-            URL url = context.getResource(slashedName);
-            if (url != null)
-            {
-               urls.add(url);
-            }
-         }
-         catch (MalformedURLException e)
-         {
-            log.error("Malformed URL loading " + name, e);
-         }
-      }
       return urls;
    }
 
@@ -173,10 +117,4 @@
    {
       return name.startsWith("/") ? name.substring(1) : name;
    }
-
-   private static String getSlashedName(String name)
-   {
-      return name.startsWith("/") ? name : "/" + name;
-   }
-
 }



More information about the weld-commits mailing list