myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r1414697 [1/3] - in /myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources: ./ deprecated/
Date Wed, 28 Nov 2012 14:07:37 GMT
Author: werpu
Date: Wed Nov 28 14:07:34 2012
New Revision: 1414697

URL: http://svn.apache.org/viewvc?rev=1414697&view=rev
Log:
changed the resource handlers to a simpler code

Added:
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/LocalResource.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/LocalResourceHandler.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/AliasResourceMetaImpl.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/AliasResourceMetaImpl.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/BaseResourceHandlerSupport.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/BaseResourceHandlerSupport.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/ClassLoaderResourceLoader.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ClassLoaderResourceLoader.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/ExternalContextResourceLoader.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ExternalContextResourceLoader.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/FacesServletMapping.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/FacesServletMapping.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/ResourceHandlerCache.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceHandlerCache.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/ResourceHandlerImpl.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceHandlerImpl.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/ResourceHandlerSupport.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceHandlerSupport.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/ResourceImpl.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceImpl.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/ResourceLoader.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceLoader.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/ResourceLoaderUtils.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceLoaderUtils.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/ResourceMeta.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceMeta.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/ResourceMetaImpl.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceMetaImpl.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/SourceResourceHandler.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/SourceResourceHandler.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/SourceResourceHandlerSupport.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/SourceResourceHandlerSupport.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/SourceResourceLoader.java
      - copied, changed from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/SourceResourceLoader.java
Removed:
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/AliasResourceMetaImpl.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/BaseResourceHandlerSupport.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ClassLoaderResourceLoader.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ExternalContextResourceLoader.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/FacesServletMapping.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceHandlerCache.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceHandlerImpl.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceHandlerSupport.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceImpl.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceLoader.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceLoaderUtils.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceMeta.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ResourceMetaImpl.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/SourceResourceHandler.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/SourceResourceHandlerSupport.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/SourceResourceLoader.java

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/LocalResource.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/LocalResource.java?rev=1414697&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/LocalResource.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/LocalResource.java Wed Nov 28 14:07:34 2012
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.extensions.scripting.jsf.resources;
+
+import javax.faces.application.Resource;
+import javax.faces.application.ResourceHandler;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class LocalResource extends Resource
+{
+    File _location;
+
+    public LocalResource(final String libraryName, final String resourceName, File location)
+    {
+        setLibraryName(libraryName);
+        setResourceName(resourceName);
+        setContentType(FacesContext.getCurrentInstance().getExternalContext().getMimeType(resourceName));
+        _location = location;
+    }
+
+    public LocalResource(final String libraryName, final String resourceName, File location, String contentType)
+    {
+        setLibraryName(libraryName);
+        setResourceName(resourceName);
+        setContentType(contentType);
+        _location = location;
+    }
+
+    @Override
+    public InputStream getInputStream() throws IOException
+    {
+        return new FileInputStream(_location);
+
+    }
+
+    @Override
+    public Map<String, String> getResponseHeaders()
+    {
+        return new HashMap<String, String>();
+    }
+
+    @Override
+    public String getRequestPath()
+    {
+        final FacesContext context = FacesContext.getCurrentInstance();
+        ExternalContext externalContext = context.getExternalContext();
+        String mapping = calculatePrefixMapping(externalContext.getRequestServletPath(),
+                externalContext.getRequestPathInfo());
+        boolean prefixMapping = true;
+        if (mapping == null)
+        {
+            prefixMapping = false;
+            mapping = calculatePostfixMapping(externalContext.getRequestServletPath(),
+                    externalContext.getRequestPathInfo());
+        }
+        if (prefixMapping)
+        {
+            return context
+                    .getApplication()
+                    .getViewHandler()
+                    .getResourceURL(
+                            context, mapping +
+                            ResourceHandler.RESOURCE_IDENTIFIER + "/" + getResourceName()
+                            + "?ln=" + getLibraryName());
+        } else
+        {
+            return context
+                    .getApplication()
+                    .getViewHandler()
+                    .getResourceURL(
+                            context,
+                            ResourceHandler.RESOURCE_IDENTIFIER + "/" + getResourceName()
+                                    + mapping + "?ln=" + getLibraryName());
+        }
+    }
+
+    String calculatePrefixMapping(String requestServletPath, String requestPathInfo)
+    {
+        if (requestPathInfo == null) return null;
+        return requestServletPath;
+    }
+
+    String calculatePostfixMapping(String requestServletPath, String requestPathInfo)
+    {
+        int slashPos = requestServletPath.lastIndexOf('/');
+        int extensionPos = requestServletPath.lastIndexOf('.');
+        if (extensionPos > -1 && extensionPos > slashPos)
+        {
+            String extension = requestServletPath.substring(extensionPos);
+            return extension;
+        }
+        return null;
+    }
+
+    @Override
+    public URL getURL()
+    {
+        return null;
+    }
+
+    @Override
+    public boolean userAgentNeedsUpdate(final FacesContext context)
+    {
+        return true;
+    }
+}

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/LocalResourceHandler.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/LocalResourceHandler.java?rev=1414697&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/LocalResourceHandler.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/LocalResourceHandler.java Wed Nov 28 14:07:34 2012
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.extensions.scripting.jsf.resources;
+
+import org.apache.myfaces.extensions.scripting.core.api.WeavingContext;
+
+import javax.faces.application.Resource;
+import javax.faces.application.ResourceHandler;
+import javax.faces.application.ResourceHandlerWrapper;
+import javax.faces.context.FacesContext;
+import java.io.File;
+import java.util.List;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class LocalResourceHandler extends ResourceHandlerWrapper
+{
+    private final ResourceHandler _wrapped;
+
+    public LocalResourceHandler(ResourceHandler wrapped)
+    {
+        _wrapped = wrapped;
+    }
+
+    public Resource createResource(final String resourceName, final String libraryName)
+    {
+        List<String> resourceRoots = WeavingContext.getInstance().getConfiguration().getResourceDirs();
+        if (resourceRoots == null || resourceRoots.isEmpty())
+        {
+            return _wrapped.createResource(resourceName, libraryName);
+        }
+
+        for (String resourceRoot : resourceRoots)
+        {
+            File resourceFile = new File(resourceRoot + "/resources/" + libraryName + "/" + resourceName);
+            if (resourceFile.exists())
+            {
+                return new LocalResource(libraryName, resourceName, resourceFile);
+            }
+            resourceFile = new File(resourceRoot + "/META-INF/resources/" + libraryName + "/" + resourceName);
+            if (resourceFile.exists())
+            {
+                return new LocalResource(libraryName, resourceName, resourceFile);
+            }
+            resourceFile = new File(resourceRoot + "/" + libraryName + "/" + resourceName);
+            if (resourceFile.exists())
+            {
+                return new LocalResource(libraryName, resourceName, resourceFile);
+            }
+        }
+        return _wrapped.createResource(resourceName, libraryName);
+    }
+
+    public Resource createResource(final String resourceName, final String libraryName, String contentType)
+    {
+        List<String> resourceRoots = WeavingContext.getInstance().getConfiguration().getResourceDirs();
+        if (resourceRoots == null || resourceRoots.isEmpty())
+        {
+            return _wrapped.createResource(resourceName, libraryName);
+        }
+
+        for (String resourceRoot : resourceRoots)
+        {
+            File resourceFile = new File(resourceRoot + "/resources/" + libraryName + "/" + resourceName);
+            if (resourceFile.exists())
+            {
+                return new LocalResource(libraryName, resourceName, resourceFile);
+            }
+            resourceFile = new File(resourceRoot + "/META_INF/resources/" + libraryName + "/" + resourceName);
+            if (resourceFile.exists())
+            {
+                return new LocalResource(libraryName, resourceName, resourceFile);
+            }
+            resourceFile = new File(resourceRoot + "/" + libraryName + "/" + resourceName);
+            if (resourceFile.exists())
+            {
+                return new LocalResource(libraryName, resourceName, resourceFile);
+            }
+
+        }
+        return _wrapped.createResource(resourceName, libraryName);
+    }
+
+    @Override
+    public boolean isResourceRequest(FacesContext context)
+    {
+        return super.isResourceRequest(context);
+    }
+
+    @Override
+    public ResourceHandler getWrapped()
+    {
+        return _wrapped;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/AliasResourceMetaImpl.java (from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/AliasResourceMetaImpl.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/AliasResourceMetaImpl.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/AliasResourceMetaImpl.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/AliasResourceMetaImpl.java&r1=1414696&r2=1414697&rev=1414697&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/AliasResourceMetaImpl.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/AliasResourceMetaImpl.java Wed Nov 28 14:07:34 2012
@@ -1,96 +1,96 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.extensions.scripting.jsf.resources;
-
-/**
- * Contains the metadata information to reference a resource 
- * 
- * @author Leonardo Uribe (latest modification by $Author: lu4242 $)
- * @version $Revision: 700544 $ $Date: 2008-09-30 13:44:02 -0500 (Mar, 30 Sep 2008) $
- */
-public class AliasResourceMetaImpl extends ResourceMetaImpl
-{
-    private String _realResourceName;
-    
-    private boolean _couldContainValueExpressions;
-
-    public AliasResourceMetaImpl(String prefix, String libraryName, String libraryVersion,
-            String resourceName, String resourceVersion, String realResourceName, boolean couldContainValueExpressions)
-    {
-        super(prefix, libraryName, libraryVersion,
-            resourceName, resourceVersion);
-        _realResourceName = realResourceName;
-        _couldContainValueExpressions = couldContainValueExpressions;
-    }
-    
-    public String getRealResourceName()
-    {
-        return _realResourceName;
-    }
-
-    public void setRealResourceName(String realResourceName)
-    {
-        _realResourceName = realResourceName;
-    }
-    
-    @Override
-    public String getResourceIdentifier()
-    {
-        StringBuilder builder = new StringBuilder();
-        boolean firstSlashAdded = false;
-        if (getLocalePrefix() != null && getLocalePrefix().length() > 0)
-        {
-            builder.append(getLocalePrefix());
-            firstSlashAdded = true;
-        }
-        if (getLibraryName() != null)
-        {
-            if (firstSlashAdded) builder.append('/');
-            builder.append(getLibraryName());
-            firstSlashAdded = true;
-        }
-        if (getLibraryVersion() != null)
-        {
-            if (firstSlashAdded) builder.append('/');
-            builder.append(getLibraryVersion());
-            firstSlashAdded = true;
-        }
-        if (getRealResourceName() != null)
-        {
-            if (firstSlashAdded) builder.append('/');
-            builder.append(getRealResourceName());
-            firstSlashAdded = true;
-        }
-        if (getResourceVersion() != null)
-        {
-            if (firstSlashAdded) builder.append('/');
-            builder.append(getResourceVersion());
-            builder.append(
-                    getRealResourceName().substring(getRealResourceName().lastIndexOf('.')));
-            firstSlashAdded = true;
-        }
-        return builder.toString();
-    }
-
-    @Override
-    public boolean couldResourceContainValueExpressions()
-    {
-        return _couldContainValueExpressions;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.scripting.jsf.resources.deprecated;
+
+/**
+ * Contains the metadata information to reference a resource 
+ * 
+ * @author Leonardo Uribe (latest modification by $Author: lu4242 $)
+ * @version $Revision: 700544 $ $Date: 2008-09-30 13:44:02 -0500 (Mar, 30 Sep 2008) $
+ */
+public class AliasResourceMetaImpl extends ResourceMetaImpl
+{
+    private String _realResourceName;
+    
+    private boolean _couldContainValueExpressions;
+
+    public AliasResourceMetaImpl(String prefix, String libraryName, String libraryVersion,
+            String resourceName, String resourceVersion, String realResourceName, boolean couldContainValueExpressions)
+    {
+        super(prefix, libraryName, libraryVersion,
+            resourceName, resourceVersion);
+        _realResourceName = realResourceName;
+        _couldContainValueExpressions = couldContainValueExpressions;
+    }
+    
+    public String getRealResourceName()
+    {
+        return _realResourceName;
+    }
+
+    public void setRealResourceName(String realResourceName)
+    {
+        _realResourceName = realResourceName;
+    }
+    
+    @Override
+    public String getResourceIdentifier()
+    {
+        StringBuilder builder = new StringBuilder();
+        boolean firstSlashAdded = false;
+        if (getLocalePrefix() != null && getLocalePrefix().length() > 0)
+        {
+            builder.append(getLocalePrefix());
+            firstSlashAdded = true;
+        }
+        if (getLibraryName() != null)
+        {
+            if (firstSlashAdded) builder.append('/');
+            builder.append(getLibraryName());
+            firstSlashAdded = true;
+        }
+        if (getLibraryVersion() != null)
+        {
+            if (firstSlashAdded) builder.append('/');
+            builder.append(getLibraryVersion());
+            firstSlashAdded = true;
+        }
+        if (getRealResourceName() != null)
+        {
+            if (firstSlashAdded) builder.append('/');
+            builder.append(getRealResourceName());
+            firstSlashAdded = true;
+        }
+        if (getResourceVersion() != null)
+        {
+            if (firstSlashAdded) builder.append('/');
+            builder.append(getResourceVersion());
+            builder.append(
+                    getRealResourceName().substring(getRealResourceName().lastIndexOf('.')));
+            firstSlashAdded = true;
+        }
+        return builder.toString();
+    }
+
+    @Override
+    public boolean couldResourceContainValueExpressions()
+    {
+        return _couldContainValueExpressions;
+    }
+}

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/BaseResourceHandlerSupport.java (from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/BaseResourceHandlerSupport.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/BaseResourceHandlerSupport.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/BaseResourceHandlerSupport.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/BaseResourceHandlerSupport.java&r1=1414696&r2=1414697&rev=1414697&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/BaseResourceHandlerSupport.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/BaseResourceHandlerSupport.java Wed Nov 28 14:07:34 2012
@@ -1,236 +1,236 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.extensions.scripting.jsf.resources;
-
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import java.util.Map;
-
-/**
- * A ResourceHandlerSupport implementation for use with standard Java Servlet engines,
- * ie an engine that supports javax.servlet, and uses a standard web.xml file.
- * 
- * @author Leonardo Uribe (latest modification by $Author: lu4242 $)
- * @version $Revision: 946779 $ $Date: 2010-05-20 15:31:42 -0500 (Jue, 20 May 2010) $
- */
-public class BaseResourceHandlerSupport extends ResourceHandlerSupport
-{
-
-    /**
-     * Set the max time in miliseconds set on the "Expires" header for a resource.
-     * (default to one week in miliseconds or 604800000) 
-     */
-    public static final String RESOURCE_MAX_TIME_EXPIRES = "org.apache.myfaces.RESOURCE_MAX_TIME_EXPIRES";
-
-    /**
-     * Identifies the FacesServlet mapping in the current request map.
-     */
-    private static final String CACHED_SERVLET_MAPPING =
-        BaseResourceHandlerSupport.class.getName() + ".CACHED_SERVLET_MAPPING";
-    
-    private Long _startupTime;
-    
-    private Long _maxTimeExpires;
-        
-    public BaseResourceHandlerSupport()
-    {
-        _startupTime = System.currentTimeMillis();
-    }
-    
-    public ResourceLoader[] getResourceLoaders()
-    {
-        return null;
-    }
-
-    public String calculateResourceBasePath(FacesContext facesContext)
-    {        
-        FacesServletMapping mapping = getFacesServletMapping(facesContext);
-        ExternalContext externalContext = facesContext.getExternalContext();      
-        
-        if (mapping != null)
-        {
-            String resourceBasePath = null;
-            if (mapping.isExtensionMapping())
-            {
-                // Mapping using a suffix. In this case we have to strip 
-                // the suffix. If we have a url like:
-                // http://localhost:8080/testjsf20/javax.faces.resource/imagen.jpg.jsf?ln=dojo
-                // 
-                // The servlet path is /javax.faces.resource/imagen.jpg.jsf
-                //
-                // For obtain the resource name we have to remove the .jsf suffix and 
-                // the prefix ResourceHandler.RESOURCE_IDENTIFIER
-                resourceBasePath = externalContext.getRequestServletPath();
-                int stripPoint = resourceBasePath.lastIndexOf('.');
-                if (stripPoint > 0)
-                {
-                    resourceBasePath = resourceBasePath.substring(0, stripPoint);
-                }
-            }
-            else
-            {
-                // Mapping using prefix. In this case we have to strip 
-                // the prefix used for mapping. If we have a url like:
-                // http://localhost:8080/testjsf20/faces/javax.faces.resource/imagen.jpg?ln=dojo
-                //
-                // The servlet path is /faces
-                // and the path info is /javax.faces.resource/imagen.jpg
-                //
-                // For obtain the resource name we have to remove the /faces prefix and 
-                // then the prefix ResourceHandler.RESOURCE_IDENTIFIER
-                resourceBasePath = externalContext.getRequestPathInfo();
-            }
-            return resourceBasePath;            
-        }
-        else
-        {
-            //If no mapping is detected, just return the
-            //information follows the servlet path but before
-            //the query string
-            return externalContext.getRequestPathInfo();
-        }
-    }
-
-    public boolean isExtensionMapping()
-    {
-        FacesServletMapping mapping = getFacesServletMapping(
-                FacesContext.getCurrentInstance());
-        if (mapping != null)
-        {
-            if (mapping.isExtensionMapping())
-            {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    public String getMapping()
-    {
-        FacesServletMapping mapping = getFacesServletMapping(
-                FacesContext.getCurrentInstance());
-        if (mapping != null)
-        {
-            if (mapping.isExtensionMapping())
-            {
-                return mapping.getExtension();
-            }
-            else
-            {
-                return mapping.getPrefix();
-            }
-        }
-        return "";
-    }
-
-    /**
-     * Read the web.xml file that is in the classpath and parse its internals to
-     * figure out how the FacesServlet is mapped for the current webapp.
-     */
-    protected FacesServletMapping getFacesServletMapping(FacesContext context)
-    {
-        Map<Object, Object> attributes = context.getAttributes();
-
-        // Has the mapping already been determined during this request?
-        FacesServletMapping mapping = (FacesServletMapping) attributes.get(CACHED_SERVLET_MAPPING);
-        if (mapping == null)
-        {
-            ExternalContext externalContext = context.getExternalContext();
-            mapping = calculateFacesServletMapping(externalContext.getRequestServletPath(),
-                    externalContext.getRequestPathInfo());
-
-            attributes.put(CACHED_SERVLET_MAPPING, mapping);
-        }
-        return mapping;
-    }
-
-    /**
-     * Determines the mapping of the FacesServlet in the web.xml configuration
-     * file. However, there is no need to actually parse this configuration file
-     * as runtime information is sufficient.
-     *
-     * @param servletPath The servletPath of the current request
-     * @param pathInfo    The pathInfo of the current request
-     * @return the mapping of the FacesServlet in the web.xml configuration file
-     */
-    protected static FacesServletMapping calculateFacesServletMapping(
-        String servletPath, String pathInfo)
-    {
-        if (pathInfo != null)
-        {
-            // If there is a "extra path", it's definitely no extension mapping.
-            // Now we just have to determine the path which has been specified
-            // in the url-pattern, but that's easy as it's the same as the
-            // current servletPath. It doesn't even matter if "/*" has been used
-            // as in this case the servletPath is just an empty string according
-            // to the Servlet Specification (SRV 4.4).
-            return FacesServletMapping.createPrefixMapping(servletPath);
-        }
-        else
-        {
-            // In the case of extension mapping, no "extra path" is available.
-            // Still it's possible that prefix-based mapping has been used.
-            // Actually, if there was an exact match no "extra path"
-            // is available (e.g. if the url-pattern is "/faces/*"
-            // and the request-uri is "/context/faces").
-            int slashPos = servletPath.lastIndexOf('/');
-            int extensionPos = servletPath.lastIndexOf('.');
-            if (extensionPos > -1 && extensionPos > slashPos)
-            {
-                String extension = servletPath.substring(extensionPos);
-                return FacesServletMapping.createExtensionMapping(extension);
-            }
-            else
-            {
-                // There is no extension in the given servletPath and therefore
-                // we assume that it's an exact match using prefix-based mapping.
-                return FacesServletMapping.createPrefixMapping(servletPath);
-            }
-        }
-    }
-
-    public long getStartupTime()
-    {
-        return _startupTime;
-    }
-    
-    public long getMaxTimeExpires()
-    {
-        if (_maxTimeExpires == null)
-        {
-            String time = FacesContext.getCurrentInstance().getExternalContext().getInitParameter(RESOURCE_MAX_TIME_EXPIRES);
-            if (time != null && time.length() > 0)
-            {
-                try
-                {
-                    _maxTimeExpires = Long.parseLong(time);
-                }
-                catch (NumberFormatException e)
-                {
-                    _maxTimeExpires = 604800000L;
-                }
-            }
-            else
-            {
-                _maxTimeExpires = 604800000L;
-            }
-        }
-        return _maxTimeExpires;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.scripting.jsf.resources.deprecated;
+
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import java.util.Map;
+
+/**
+ * A ResourceHandlerSupport implementation for use with standard Java Servlet engines,
+ * ie an engine that supports javax.servlet, and uses a standard web.xml file.
+ * 
+ * @author Leonardo Uribe (latest modification by $Author: lu4242 $)
+ * @version $Revision: 946779 $ $Date: 2010-05-20 15:31:42 -0500 (Jue, 20 May 2010) $
+ */
+public class BaseResourceHandlerSupport extends ResourceHandlerSupport
+{
+
+    /**
+     * Set the max time in miliseconds set on the "Expires" header for a resource.
+     * (default to one week in miliseconds or 604800000) 
+     */
+    public static final String RESOURCE_MAX_TIME_EXPIRES = "org.apache.myfaces.RESOURCE_MAX_TIME_EXPIRES";
+
+    /**
+     * Identifies the FacesServlet mapping in the current request map.
+     */
+    private static final String CACHED_SERVLET_MAPPING =
+        BaseResourceHandlerSupport.class.getName() + ".CACHED_SERVLET_MAPPING";
+    
+    private Long _startupTime;
+    
+    private Long _maxTimeExpires;
+        
+    public BaseResourceHandlerSupport()
+    {
+        _startupTime = System.currentTimeMillis();
+    }
+    
+    public ResourceLoader[] getResourceLoaders()
+    {
+        return null;
+    }
+
+    public String calculateResourceBasePath(FacesContext facesContext)
+    {        
+        FacesServletMapping mapping = getFacesServletMapping(facesContext);
+        ExternalContext externalContext = facesContext.getExternalContext();      
+        
+        if (mapping != null)
+        {
+            String resourceBasePath = null;
+            if (mapping.isExtensionMapping())
+            {
+                // Mapping using a suffix. In this case we have to strip 
+                // the suffix. If we have a url like:
+                // http://localhost:8080/testjsf20/javax.faces.resource/imagen.jpg.jsf?ln=dojo
+                // 
+                // The servlet path is /javax.faces.resource/imagen.jpg.jsf
+                //
+                // For obtain the resource name we have to remove the .jsf suffix and 
+                // the prefix ResourceHandler.RESOURCE_IDENTIFIER
+                resourceBasePath = externalContext.getRequestServletPath();
+                int stripPoint = resourceBasePath.lastIndexOf('.');
+                if (stripPoint > 0)
+                {
+                    resourceBasePath = resourceBasePath.substring(0, stripPoint);
+                }
+            }
+            else
+            {
+                // Mapping using prefix. In this case we have to strip 
+                // the prefix used for mapping. If we have a url like:
+                // http://localhost:8080/testjsf20/faces/javax.faces.resource/imagen.jpg?ln=dojo
+                //
+                // The servlet path is /faces
+                // and the path info is /javax.faces.resource/imagen.jpg
+                //
+                // For obtain the resource name we have to remove the /faces prefix and 
+                // then the prefix ResourceHandler.RESOURCE_IDENTIFIER
+                resourceBasePath = externalContext.getRequestPathInfo();
+            }
+            return resourceBasePath;            
+        }
+        else
+        {
+            //If no mapping is detected, just return the
+            //information follows the servlet path but before
+            //the query string
+            return externalContext.getRequestPathInfo();
+        }
+    }
+
+    public boolean isExtensionMapping()
+    {
+        FacesServletMapping mapping = getFacesServletMapping(
+                FacesContext.getCurrentInstance());
+        if (mapping != null)
+        {
+            if (mapping.isExtensionMapping())
+            {
+                return true;
+            }
+        }
+        return false;
+    }
+    
+    public String getMapping()
+    {
+        FacesServletMapping mapping = getFacesServletMapping(
+                FacesContext.getCurrentInstance());
+        if (mapping != null)
+        {
+            if (mapping.isExtensionMapping())
+            {
+                return mapping.getExtension();
+            }
+            else
+            {
+                return mapping.getPrefix();
+            }
+        }
+        return "";
+    }
+
+    /**
+     * Read the web.xml file that is in the classpath and parse its internals to
+     * figure out how the FacesServlet is mapped for the current webapp.
+     */
+    protected FacesServletMapping getFacesServletMapping(FacesContext context)
+    {
+        Map<Object, Object> attributes = context.getAttributes();
+
+        // Has the mapping already been determined during this request?
+        FacesServletMapping mapping = (FacesServletMapping) attributes.get(CACHED_SERVLET_MAPPING);
+        if (mapping == null)
+        {
+            ExternalContext externalContext = context.getExternalContext();
+            mapping = calculateFacesServletMapping(externalContext.getRequestServletPath(),
+                    externalContext.getRequestPathInfo());
+
+            attributes.put(CACHED_SERVLET_MAPPING, mapping);
+        }
+        return mapping;
+    }
+
+    /**
+     * Determines the mapping of the FacesServlet in the web.xml configuration
+     * file. However, there is no need to actually parse this configuration file
+     * as runtime information is sufficient.
+     *
+     * @param servletPath The servletPath of the current request
+     * @param pathInfo    The pathInfo of the current request
+     * @return the mapping of the FacesServlet in the web.xml configuration file
+     */
+    protected static FacesServletMapping calculateFacesServletMapping(
+        String servletPath, String pathInfo)
+    {
+        if (pathInfo != null)
+        {
+            // If there is a "extra path", it's definitely no extension mapping.
+            // Now we just have to determine the path which has been specified
+            // in the url-pattern, but that's easy as it's the same as the
+            // current servletPath. It doesn't even matter if "/*" has been used
+            // as in this case the servletPath is just an empty string according
+            // to the Servlet Specification (SRV 4.4).
+            return FacesServletMapping.createPrefixMapping(servletPath);
+        }
+        else
+        {
+            // In the case of extension mapping, no "extra path" is available.
+            // Still it's possible that prefix-based mapping has been used.
+            // Actually, if there was an exact match no "extra path"
+            // is available (e.g. if the url-pattern is "/faces/*"
+            // and the request-uri is "/context/faces").
+            int slashPos = servletPath.lastIndexOf('/');
+            int extensionPos = servletPath.lastIndexOf('.');
+            if (extensionPos > -1 && extensionPos > slashPos)
+            {
+                String extension = servletPath.substring(extensionPos);
+                return FacesServletMapping.createExtensionMapping(extension);
+            }
+            else
+            {
+                // There is no extension in the given servletPath and therefore
+                // we assume that it's an exact match using prefix-based mapping.
+                return FacesServletMapping.createPrefixMapping(servletPath);
+            }
+        }
+    }
+
+    public long getStartupTime()
+    {
+        return _startupTime;
+    }
+    
+    public long getMaxTimeExpires()
+    {
+        if (_maxTimeExpires == null)
+        {
+            String time = FacesContext.getCurrentInstance().getExternalContext().getInitParameter(RESOURCE_MAX_TIME_EXPIRES);
+            if (time != null && time.length() > 0)
+            {
+                try
+                {
+                    _maxTimeExpires = Long.parseLong(time);
+                }
+                catch (NumberFormatException e)
+                {
+                    _maxTimeExpires = 604800000L;
+                }
+            }
+            else
+            {
+                _maxTimeExpires = 604800000L;
+            }
+        }
+        return _maxTimeExpires;
+    }
+}

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/ClassLoaderResourceLoader.java (from r1414696, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ClassLoaderResourceLoader.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/ClassLoaderResourceLoader.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/ClassLoaderResourceLoader.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ClassLoaderResourceLoader.java&r1=1414696&r2=1414697&rev=1414697&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/ClassLoaderResourceLoader.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/ClassLoaderResourceLoader.java Wed Nov 28 14:07:34 2012
@@ -1,480 +1,480 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.extensions.scripting.jsf.resources;
-
-
-import org.apache.myfaces.extensions.scripting.core.common.util.ClassLoaderUtils;
-
-import javax.faces.application.ProjectStage;
-import javax.faces.context.FacesContext;
-import java.io.InputStream;
-import java.net.URL;
-
-/**
- * A resource loader implementation which loads resources from the thread ClassLoader.
- * 
- */
-public class ClassLoaderResourceLoader extends ResourceLoader
-{
-    /**
-     * It checks version like this: 1, 1_0, 1_0_0, 100_100
-     * 
-     * Used on getLibraryVersion to filter resource directories
-     **/
-    //protected static Pattern VERSION_CHECKER = Pattern.compile("\\p{Digit}+(_\\p{Digit}*)*");
-
-    /**
-     * It checks version like this: /1.js, /1_0.js, /1_0_0.js, /100_100.js
-     * 
-     * Used on getResourceVersion to filter resources
-     **/
-    //protected static Pattern RESOURCE_VERSION_CHECKER = Pattern.compile("/\\p{Digit}+(_\\p{Digit}*)*\\..*");
-
-    /*
-    private FileFilter _libraryFileFilter = new FileFilter()
-    {
-        public boolean accept(File pathname)
-        {
-            if (pathname.isDirectory() && VERSION_CHECKER.matcher(pathname.getName()).matches())
-            {
-                return true;
-            }
-            return false;
-        }
-    };*/
-
-    /*
-    private FileFilter _resourceFileFilter = new FileFilter()
-    {
-        public boolean accept(File pathname)
-        {
-            if (pathname.isDirectory() && RESOURCE_VERSION_CHECKER.matcher(pathname.getName()).matches())
-            {
-                return true;
-            }
-            return false;
-        }
-    };*/
-    
-    private final boolean _developmentStage;
-
-    public ClassLoaderResourceLoader(String prefix)
-    {
-        super(prefix);
-        _developmentStage = FacesContext.getCurrentInstance().isProjectStage(ProjectStage.Development);
-    }
-
-    @Override
-    public String getLibraryVersion(String path)
-    {
-        return null;
-        /*
-        String libraryVersion = null;
-        if (getPrefix() != null)
-            path = getPrefix() + '/' + path;
-
-        URL url = getClassLoader().getResource(path);
-
-        if (url == null)
-        {
-            // This library does not exists for this
-            // ResourceLoader
-            return null;
-        }
-
-        // The problem here is how to scan the directory. When a ClassLoader
-        // is used two cases could occur
-        // 1. The files are unpacked so we can use Url.toURI and crawl
-        // the directory using the api for files.
-        // 2. The files are packed in a jar. This case is more tricky,
-        // because we only have a URL. Checking the jar api we can use
-        // JarURLConnection (Sounds strange, but the api of
-        // URL.openConnection says that for a jar connection a
-        // JarURLConnection is returned). From this point we can access
-        // to the jar api and solve the algoritm.
-        if (url.getProtocol().equals("file"))
-        {
-            try
-            {
-                File directory = new File(url.toURI());
-                if (directory.isDirectory())
-                {
-                    File[] versions = directory.listFiles(_libraryFileFilter);
-                    for (int i = 0; i < versions.length; i++)
-                    {
-                        String version = versions[i].getName();
-                        if (VERSION_CHECKER.matcher(version).matches())
-                        {
-                            if (libraryVersion == null)
-                            {
-                                libraryVersion = version;
-                            }
-                            else if (getVersionComparator().compare(libraryVersion, version) < 0)
-                            {
-                                libraryVersion = version;
-                            }
-                        }
-                    }
-                }
-            }
-            catch (URISyntaxException e)
-            {
-                // Just return null, because library version cannot be
-                // resolved.
-                Logger log = Logger.getLogger(ClassLoaderResourceLoader.class.getName()); 
-                if (log.isLoggable(Level.WARNING))
-                {
-                    log.log(Level.WARNING, "url "+url.toString()+" cannot be translated to uri: "+e.getMessage(), e);
-                }
-            }
-        }
-        else if (isJarResourceProtocol(url.getProtocol()))
-        {
-            try
-            {
-                url = getClassLoader().getResource(path + '/');
-
-                if (url != null)
-                {
-                    JarURLConnection conn = (JarURLConnection)url.openConnection();
-                    // See DIGESTER-29 for related problem
-                    conn.setUseCaches(false);
-
-                    try
-                    {
-                        if (conn.getJarEntry().isDirectory())
-                        {
-                            // Unfortunately, we have to scan all entry files
-                            // because there is no proper api to scan it as a
-                            // directory tree.
-                            JarFile file = conn.getJarFile();
-                            for (Enumeration<JarEntry> en = file.entries(); en.hasMoreElements();)
-                            {
-                                JarEntry entry = en.nextElement();
-                                String entryName = entry.getName();
-    
-                                if (entryName.startsWith(path + '/'))
-                                {
-                                    if (entryName.length() == path.length() + 1)
-                                    {
-                                        // the same string, just skip it
-                                        continue;
-                                    }
-    
-                                    if (entryName.charAt(entryName.length() - 1) != '/')
-                                    {
-                                        // Skip files
-                                        continue;
-                                    }
-    
-                                    entryName = entryName.substring(path.length() + 1, entryName.length() - 1);
-    
-                                    if (entryName.indexOf('/') >= 0)
-                                    {
-                                        // Inner Directory
-                                        continue;
-                                    }
-    
-                                    String version = entryName;
-                                    if (VERSION_CHECKER.matcher(version).matches())
-                                    {
-                                        if (libraryVersion == null)
-                                        {
-                                            libraryVersion = version;
-                                        }
-                                        else if (getVersionComparator().compare(libraryVersion, version) < 0)
-                                        {
-                                            libraryVersion = version;
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    finally
-                    {
-                        //See TRINIDAD-73
-                        //just close the input stream again if
-                        //by inspecting the entries the stream
-                        //was let open.
-                        try
-                        {
-                            conn.getInputStream().close();
-                        }
-                        catch (Exception exception)
-                        {
-                            // Ignored
-                        }
-                    }
-                }
-            }
-            catch (IOException e)
-            {
-                // Just return null, because library version cannot be
-                // resolved.
-                Logger log = Logger.getLogger(ClassLoaderResourceLoader.class.getName()); 
-                if (log.isLoggable(Level.WARNING))
-                {
-                    log.log(Level.WARNING, "IOException when scanning for resource in jar file:", e);
-                }
-            }
-        }
-        return libraryVersion;
-        */
-    }
-
-    @Override
-    public InputStream getResourceInputStream(ResourceMeta resourceMeta)
-    {
-        if (getPrefix() != null && !"".equals(getPrefix()))
-        {
-            return getClassLoader().getResourceAsStream(getPrefix() + '/' + resourceMeta.getResourceIdentifier());
-        }
-        else
-        {
-            return getClassLoader().getResourceAsStream(resourceMeta.getResourceIdentifier());
-        }
-    }
-
-    @Override
-    public URL getResourceURL(ResourceMeta resourceMeta)
-    {
-        if (getPrefix() != null && !"".equals(getPrefix()))
-        {
-            return getClassLoader().getResource(getPrefix() + '/' + resourceMeta.getResourceIdentifier());
-        }
-        else
-        {
-            return getClassLoader().getResource(resourceMeta.getResourceIdentifier());
-        }
-    }
-
-    @Override
-    public String getResourceVersion(String path)
-    {
-        return null;
-        /*
-        String resourceVersion = null;
-
-        if (getPrefix() != null)
-            path = getPrefix() + '/' + path;
-
-        URL url = getClassLoader().getResource(path);
-
-        if (url == null)
-        {
-            // This library does not exists for this
-            // ResourceLoader
-            return null;
-        }
-
-        if (url.getProtocol().equals("file"))
-        {
-            try
-            {
-                File directory = new File(url.toURI());
-                if (directory.isDirectory())
-                {
-                    File[] versions = directory.listFiles(_resourceFileFilter);
-                    for (int i = 0; i < versions.length; i++)
-                    {
-                        String version = versions[i].getName();
-                        if (resourceVersion == null)
-                        {
-                            resourceVersion = version;
-                        }
-                        else if (getVersionComparator().compare(resourceVersion, version) < 0)
-                        {
-                            resourceVersion = version;
-                        }
-                    }
-                    //Since it is a directory and no version found set resourceVersion as invalid
-                    if (resourceVersion == null)
-                    {
-                        resourceVersion = VERSION_INVALID;
-                    }
-                }
-            }
-            catch (URISyntaxException e)
-            {
-                Logger log = Logger.getLogger(ClassLoaderResourceLoader.class.getName()); 
-                if (log.isLoggable(Level.WARNING))
-                {
-                    log.log(Level.WARNING, "url "+url.toString()+" cannot be translated to uri: "+e.getMessage(), e);
-                }
-            }
-        }
-        else if (isJarResourceProtocol(url.getProtocol()))
-        {
-            try
-            {
-                url = getClassLoader().getResource(path + '/');
-
-                if (url != null)
-                {
-                    JarURLConnection conn = (JarURLConnection)url.openConnection();
-                    // See DIGESTER-29 for related problem
-                    conn.setUseCaches(false);
-
-                    try
-                    {
-                        if (conn.getJarEntry().isDirectory())
-                        {
-                            // Unfortunately, we have to scan all entry files
-                            JarFile file = conn.getJarFile();
-                            for (Enumeration<JarEntry> en = file.entries(); en.hasMoreElements();)
-                            {
-                                JarEntry entry = en.nextElement();
-                                String entryName = entry.getName();
-    
-                                if (entryName.startsWith(path + '/'))
-                                {
-                                    if (entryName.length() == path.length() + 1)
-                                    {
-                                        // the same string, just skip it
-                                        continue;
-                                    }
-        
-                                    entryName = entryName.substring(path.length());
-                                    if (RESOURCE_VERSION_CHECKER.matcher(entryName).matches())
-                                    {
-                                        String version = entryName.substring(1, entryName.lastIndexOf('.'));
-                                        if (resourceVersion == null)
-                                        {
-                                            resourceVersion = version;
-                                        }
-                                        else if (getVersionComparator().compare(resourceVersion, version) < 0)
-                                        {
-                                            resourceVersion = version;
-                                        }
-                                    }
-                                }
-                            }
-                            if (resourceVersion == null)
-                            {
-                                resourceVersion = VERSION_INVALID;
-                            }
-                        }
-                    }
-                    finally
-                    {
-                        //See TRINIDAD-73
-                        //just close the input stream again if
-                        //by inspecting the entries the stream
-                        //was let open.
-                        try
-                        {
-                            conn.getInputStream().close();
-                        }
-                        catch (Exception exception)
-                        {
-                            // Ignored
-                        }
-                    }
-
-                }
-            }
-            catch (IOException e)
-            {
-                // Just return null, because library version cannot be
-                // resolved.
-                Logger log = Logger.getLogger(ClassLoaderResourceLoader.class.getName()); 
-                if (log.isLoggable(Level.WARNING))
-                {
-                    log.log(Level.WARNING, "IOException when scanning for resource in jar file:", e);
-                }
-            }
-        }
-        return resourceVersion;
-        */
-    }
-
-    @Override
-    public ResourceMeta createResourceMeta(String prefix, String libraryName, String libraryVersion,
-                                           String resourceName, String resourceVersion)
-    {
-        if (_developmentStage && libraryName != null && 
-                ResourceLoaderUtils.JAVAX_FACES_LIBRARY_NAME.equals(libraryName) &&
-                ResourceLoaderUtils.JSF_JS_RESOURCE_NAME.equals(resourceName))
-        {
-            // InternalClassLoaderResourceLoader will serve it, so return null in this case.
-            return null;
-        } else if (_developmentStage && libraryName != null &&
-                ResourceLoaderUtils.MYFACES_LIBRARY_NAME.equals(libraryName) &&
-                ResourceLoaderUtils.MYFACES_JS_RESOURCE_NAME.equals(resourceName)) {
-            // InternalClassLoaderResourceLoader will serve it, so return null in this case.
-             return null;
-        } else
-        {
-            return new ResourceMetaImpl(prefix, libraryName, libraryVersion, resourceName, resourceVersion);
-        }
-    }
-
-    /**
-     * Returns the ClassLoader to use when looking up resources under the top level package. By default, this is the
-     * context class loader.
-     * 
-     * @return the ClassLoader used to lookup resources
-     */
-    protected ClassLoader getClassLoader()
-    {
-        return ClassLoaderUtils.getDefaultClassLoader();
-    }
-
-    @Override
-    public boolean libraryExists(String libraryName)
-    {
-        if (getPrefix() != null && !"".equals(getPrefix()))
-        {
-            URL url = getClassLoader().getResource(getPrefix() + '/' + libraryName);
-            if (url != null)
-            {
-                return true;
-            }
-        }
-        else
-        {
-            URL url = getClassLoader().getResource(libraryName);
-            if (url != null)
-            {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * <p>Determines whether the given URL resource protocol refers to a JAR file. Note that
-     * BEA WebLogic and IBM WebSphere don't use the "jar://" protocol for some reason even
-     * though you can treat these resources just like normal JAR files, i.e. you can ignore
-     * the difference between these protocols after this method has returned.</p>
-     *
-     * @param protocol the URL resource protocol you want to check
-     *
-     * @return <code>true</code> if the given URL resource protocol refers to a JAR file,
-     *          <code>false</code> otherwise
-     */
-    /*
-    private static boolean isJarResourceProtocol(String protocol)
-    {
-        // Websphere uses the protocol "wsjar://" and Weblogic uses the protocol "zip://".
-        return "jar".equals(protocol) || "wsjar".equals(protocol) || "zip".equals(protocol); 
-    }*/
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.scripting.jsf.resources.deprecated;
+
+
+import org.apache.myfaces.extensions.scripting.core.common.util.ClassLoaderUtils;
+
+import javax.faces.application.ProjectStage;
+import javax.faces.context.FacesContext;
+import java.io.InputStream;
+import java.net.URL;
+
+/**
+ * A resource loader implementation which loads resources from the thread ClassLoader.
+ * 
+ */
+public class ClassLoaderResourceLoader extends ResourceLoader
+{
+    /**
+     * It checks version like this: 1, 1_0, 1_0_0, 100_100
+     * 
+     * Used on getLibraryVersion to filter resource directories
+     **/
+    //protected static Pattern VERSION_CHECKER = Pattern.compile("\\p{Digit}+(_\\p{Digit}*)*");
+
+    /**
+     * It checks version like this: /1.js, /1_0.js, /1_0_0.js, /100_100.js
+     * 
+     * Used on getResourceVersion to filter resources
+     **/
+    //protected static Pattern RESOURCE_VERSION_CHECKER = Pattern.compile("/\\p{Digit}+(_\\p{Digit}*)*\\..*");
+
+    /*
+    private FileFilter _libraryFileFilter = new FileFilter()
+    {
+        public boolean accept(File pathname)
+        {
+            if (pathname.isDirectory() && VERSION_CHECKER.matcher(pathname.getName()).matches())
+            {
+                return true;
+            }
+            return false;
+        }
+    };*/
+
+    /*
+    private FileFilter _resourceFileFilter = new FileFilter()
+    {
+        public boolean accept(File pathname)
+        {
+            if (pathname.isDirectory() && RESOURCE_VERSION_CHECKER.matcher(pathname.getName()).matches())
+            {
+                return true;
+            }
+            return false;
+        }
+    };*/
+    
+    private final boolean _developmentStage;
+
+    public ClassLoaderResourceLoader(String prefix)
+    {
+        super(prefix);
+        _developmentStage = FacesContext.getCurrentInstance().isProjectStage(ProjectStage.Development);
+    }
+
+    @Override
+    public String getLibraryVersion(String path)
+    {
+        return null;
+        /*
+        String libraryVersion = null;
+        if (getPrefix() != null)
+            path = getPrefix() + '/' + path;
+
+        URL url = getClassLoader().getResource(path);
+
+        if (url == null)
+        {
+            // This library does not exists for this
+            // ResourceLoader
+            return null;
+        }
+
+        // The problem here is how to scan the directory. When a ClassLoader
+        // is used two cases could occur
+        // 1. The files are unpacked so we can use Url.toURI and crawl
+        // the directory using the api for files.
+        // 2. The files are packed in a jar. This case is more tricky,
+        // because we only have a URL. Checking the jar api we can use
+        // JarURLConnection (Sounds strange, but the api of
+        // URL.openConnection says that for a jar connection a
+        // JarURLConnection is returned). From this point we can access
+        // to the jar api and solve the algoritm.
+        if (url.getProtocol().equals("file"))
+        {
+            try
+            {
+                File directory = new File(url.toURI());
+                if (directory.isDirectory())
+                {
+                    File[] versions = directory.listFiles(_libraryFileFilter);
+                    for (int i = 0; i < versions.length; i++)
+                    {
+                        String version = versions[i].getName();
+                        if (VERSION_CHECKER.matcher(version).matches())
+                        {
+                            if (libraryVersion == null)
+                            {
+                                libraryVersion = version;
+                            }
+                            else if (getVersionComparator().compare(libraryVersion, version) < 0)
+                            {
+                                libraryVersion = version;
+                            }
+                        }
+                    }
+                }
+            }
+            catch (URISyntaxException e)
+            {
+                // Just return null, because library version cannot be
+                // resolved.
+                Logger log = Logger.getLogger(ClassLoaderResourceLoader.class.getName()); 
+                if (log.isLoggable(Level.WARNING))
+                {
+                    log.log(Level.WARNING, "url "+url.toString()+" cannot be translated to uri: "+e.getMessage(), e);
+                }
+            }
+        }
+        else if (isJarResourceProtocol(url.getProtocol()))
+        {
+            try
+            {
+                url = getClassLoader().getResource(path + '/');
+
+                if (url != null)
+                {
+                    JarURLConnection conn = (JarURLConnection)url.openConnection();
+                    // See DIGESTER-29 for related problem
+                    conn.setUseCaches(false);
+
+                    try
+                    {
+                        if (conn.getJarEntry().isDirectory())
+                        {
+                            // Unfortunately, we have to scan all entry files
+                            // because there is no proper api to scan it as a
+                            // directory tree.
+                            JarFile file = conn.getJarFile();
+                            for (Enumeration<JarEntry> en = file.entries(); en.hasMoreElements();)
+                            {
+                                JarEntry entry = en.nextElement();
+                                String entryName = entry.getName();
+    
+                                if (entryName.startsWith(path + '/'))
+                                {
+                                    if (entryName.length() == path.length() + 1)
+                                    {
+                                        // the same string, just skip it
+                                        continue;
+                                    }
+    
+                                    if (entryName.charAt(entryName.length() - 1) != '/')
+                                    {
+                                        // Skip files
+                                        continue;
+                                    }
+    
+                                    entryName = entryName.substring(path.length() + 1, entryName.length() - 1);
+    
+                                    if (entryName.indexOf('/') >= 0)
+                                    {
+                                        // Inner Directory
+                                        continue;
+                                    }
+    
+                                    String version = entryName;
+                                    if (VERSION_CHECKER.matcher(version).matches())
+                                    {
+                                        if (libraryVersion == null)
+                                        {
+                                            libraryVersion = version;
+                                        }
+                                        else if (getVersionComparator().compare(libraryVersion, version) < 0)
+                                        {
+                                            libraryVersion = version;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    finally
+                    {
+                        //See TRINIDAD-73
+                        //just close the input stream again if
+                        //by inspecting the entries the stream
+                        //was let open.
+                        try
+                        {
+                            conn.getInputStream().close();
+                        }
+                        catch (Exception exception)
+                        {
+                            // Ignored
+                        }
+                    }
+                }
+            }
+            catch (IOException e)
+            {
+                // Just return null, because library version cannot be
+                // resolved.
+                Logger log = Logger.getLogger(ClassLoaderResourceLoader.class.getName()); 
+                if (log.isLoggable(Level.WARNING))
+                {
+                    log.log(Level.WARNING, "IOException when scanning for resource in jar file:", e);
+                }
+            }
+        }
+        return libraryVersion;
+        */
+    }
+
+    @Override
+    public InputStream getResourceInputStream(ResourceMeta resourceMeta)
+    {
+        if (getPrefix() != null && !"".equals(getPrefix()))
+        {
+            return getClassLoader().getResourceAsStream(getPrefix() + '/' + resourceMeta.getResourceIdentifier());
+        }
+        else
+        {
+            return getClassLoader().getResourceAsStream(resourceMeta.getResourceIdentifier());
+        }
+    }
+
+    @Override
+    public URL getResourceURL(ResourceMeta resourceMeta)
+    {
+        if (getPrefix() != null && !"".equals(getPrefix()))
+        {
+            return getClassLoader().getResource(getPrefix() + '/' + resourceMeta.getResourceIdentifier());
+        }
+        else
+        {
+            return getClassLoader().getResource(resourceMeta.getResourceIdentifier());
+        }
+    }
+
+    @Override
+    public String getResourceVersion(String path)
+    {
+        return null;
+        /*
+        String resourceVersion = null;
+
+        if (getPrefix() != null)
+            path = getPrefix() + '/' + path;
+
+        URL url = getClassLoader().getResource(path);
+
+        if (url == null)
+        {
+            // This library does not exists for this
+            // ResourceLoader
+            return null;
+        }
+
+        if (url.getProtocol().equals("file"))
+        {
+            try
+            {
+                File directory = new File(url.toURI());
+                if (directory.isDirectory())
+                {
+                    File[] versions = directory.listFiles(_resourceFileFilter);
+                    for (int i = 0; i < versions.length; i++)
+                    {
+                        String version = versions[i].getName();
+                        if (resourceVersion == null)
+                        {
+                            resourceVersion = version;
+                        }
+                        else if (getVersionComparator().compare(resourceVersion, version) < 0)
+                        {
+                            resourceVersion = version;
+                        }
+                    }
+                    //Since it is a directory and no version found set resourceVersion as invalid
+                    if (resourceVersion == null)
+                    {
+                        resourceVersion = VERSION_INVALID;
+                    }
+                }
+            }
+            catch (URISyntaxException e)
+            {
+                Logger log = Logger.getLogger(ClassLoaderResourceLoader.class.getName()); 
+                if (log.isLoggable(Level.WARNING))
+                {
+                    log.log(Level.WARNING, "url "+url.toString()+" cannot be translated to uri: "+e.getMessage(), e);
+                }
+            }
+        }
+        else if (isJarResourceProtocol(url.getProtocol()))
+        {
+            try
+            {
+                url = getClassLoader().getResource(path + '/');
+
+                if (url != null)
+                {
+                    JarURLConnection conn = (JarURLConnection)url.openConnection();
+                    // See DIGESTER-29 for related problem
+                    conn.setUseCaches(false);
+
+                    try
+                    {
+                        if (conn.getJarEntry().isDirectory())
+                        {
+                            // Unfortunately, we have to scan all entry files
+                            JarFile file = conn.getJarFile();
+                            for (Enumeration<JarEntry> en = file.entries(); en.hasMoreElements();)
+                            {
+                                JarEntry entry = en.nextElement();
+                                String entryName = entry.getName();
+    
+                                if (entryName.startsWith(path + '/'))
+                                {
+                                    if (entryName.length() == path.length() + 1)
+                                    {
+                                        // the same string, just skip it
+                                        continue;
+                                    }
+        
+                                    entryName = entryName.substring(path.length());
+                                    if (RESOURCE_VERSION_CHECKER.matcher(entryName).matches())
+                                    {
+                                        String version = entryName.substring(1, entryName.lastIndexOf('.'));
+                                        if (resourceVersion == null)
+                                        {
+                                            resourceVersion = version;
+                                        }
+                                        else if (getVersionComparator().compare(resourceVersion, version) < 0)
+                                        {
+                                            resourceVersion = version;
+                                        }
+                                    }
+                                }
+                            }
+                            if (resourceVersion == null)
+                            {
+                                resourceVersion = VERSION_INVALID;
+                            }
+                        }
+                    }
+                    finally
+                    {
+                        //See TRINIDAD-73
+                        //just close the input stream again if
+                        //by inspecting the entries the stream
+                        //was let open.
+                        try
+                        {
+                            conn.getInputStream().close();
+                        }
+                        catch (Exception exception)
+                        {
+                            // Ignored
+                        }
+                    }
+
+                }
+            }
+            catch (IOException e)
+            {
+                // Just return null, because library version cannot be
+                // resolved.
+                Logger log = Logger.getLogger(ClassLoaderResourceLoader.class.getName()); 
+                if (log.isLoggable(Level.WARNING))
+                {
+                    log.log(Level.WARNING, "IOException when scanning for resource in jar file:", e);
+                }
+            }
+        }
+        return resourceVersion;
+        */
+    }
+
+    @Override
+    public ResourceMeta createResourceMeta(String prefix, String libraryName, String libraryVersion,
+                                           String resourceName, String resourceVersion)
+    {
+        if (_developmentStage && libraryName != null && 
+                ResourceLoaderUtils.JAVAX_FACES_LIBRARY_NAME.equals(libraryName) &&
+                ResourceLoaderUtils.JSF_JS_RESOURCE_NAME.equals(resourceName))
+        {
+            // InternalClassLoaderResourceLoader will serve it, so return null in this case.
+            return null;
+        } else if (_developmentStage && libraryName != null &&
+                ResourceLoaderUtils.MYFACES_LIBRARY_NAME.equals(libraryName) &&
+                ResourceLoaderUtils.MYFACES_JS_RESOURCE_NAME.equals(resourceName)) {
+            // InternalClassLoaderResourceLoader will serve it, so return null in this case.
+             return null;
+        } else
+        {
+            return new ResourceMetaImpl(prefix, libraryName, libraryVersion, resourceName, resourceVersion);
+        }
+    }
+
+    /**
+     * Returns the ClassLoader to use when looking up resources under the top level package. By default, this is the
+     * context class loader.
+     * 
+     * @return the ClassLoader used to lookup resources
+     */
+    protected ClassLoader getClassLoader()
+    {
+        return ClassLoaderUtils.getDefaultClassLoader();
+    }
+
+    @Override
+    public boolean libraryExists(String libraryName)
+    {
+        if (getPrefix() != null && !"".equals(getPrefix()))
+        {
+            URL url = getClassLoader().getResource(getPrefix() + '/' + libraryName);
+            if (url != null)
+            {
+                return true;
+            }
+        }
+        else
+        {
+            URL url = getClassLoader().getResource(libraryName);
+            if (url != null)
+            {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * <p>Determines whether the given URL resource protocol refers to a JAR file. Note that
+     * BEA WebLogic and IBM WebSphere don't use the "jar://" protocol for some reason even
+     * though you can treat these resources just like normal JAR files, i.e. you can ignore
+     * the difference between these protocols after this method has returned.</p>
+     *
+     * @param protocol the URL resource protocol you want to check
+     *
+     * @return <code>true</code> if the given URL resource protocol refers to a JAR file,
+     *          <code>false</code> otherwise
+     */
+    /*
+    private static boolean isJarResourceProtocol(String protocol)
+    {
+        // Websphere uses the protocol "wsjar://" and Weblogic uses the protocol "zip://".
+        return "jar".equals(protocol) || "wsjar".equals(protocol) || "zip".equals(protocol); 
+    }*/
+
+}



Mime
View raw message