[richfaces-svn-commits] JBoss Rich Faces SVN: r18540 - in sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk: naming and 2 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Aug 10 14:16:56 EDT 2010


Author: nbelaevski
Date: 2010-08-10 14:16:55 -0400 (Tue, 10 Aug 2010)
New Revision: 18540

Removed:
   sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/util/ConcurrentHashSet.java
Modified:
   sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceELResolver.java
   sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/naming/FileNameMapperImpl.java
   sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipVFSFile.java
Log:
Latest changes in maven-resources-plugin

Modified: sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceELResolver.java
===================================================================
--- sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceELResolver.java	2010-08-10 17:53:21 UTC (rev 18539)
+++ sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceELResolver.java	2010-08-10 18:16:55 UTC (rev 18540)
@@ -37,6 +37,9 @@
 import javax.faces.application.ResourceHandler;
 import javax.faces.context.FacesContext;
 
+import org.richfaces.application.ServiceTracker;
+import org.richfaces.cdk.FileNameMapper;
+
 import com.google.common.collect.Lists;
 
 /**
@@ -89,6 +92,10 @@
         return SLASH_JOINER.join(resultPathSegments);
     }
 
+    private FileNameMapper getFileNameMapper() {
+        return ServiceTracker.getService(FileNameMapper.class);
+    }
+    
     public Object getValue(ELContext context, Object base, Object property) {
         checkBaseAndProperty(base, property);
 
@@ -109,11 +116,13 @@
             context.setPropertyResolved(true);
 
             if (resource != null) {
-                String requestPath = resource.getRequestPath();
+                FileNameMapper fileNameMapper = getFileNameMapper();
+                
+                String requestPath = fileNameMapper.createName(resource);
                 FacesContext facesContext = (FacesContext) context.getContext(FacesContext.class);
                 Resource contextResource = CurrentResourceContext.getInstance(facesContext).getResource();
                 if (contextResource != null) {
-                    requestPath = relativize(resource.getRequestPath(), contextResource.getRequestPath());
+                    requestPath = relativize(requestPath, fileNameMapper.createName(contextResource));
                 }
 
                 return requestPath;

Modified: sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/naming/FileNameMapperImpl.java
===================================================================
--- sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/naming/FileNameMapperImpl.java	2010-08-10 17:53:21 UTC (rev 18539)
+++ sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/naming/FileNameMapperImpl.java	2010-08-10 18:16:55 UTC (rev 18540)
@@ -80,6 +80,7 @@
         return result;
     }
 
+    //TODO implement counter remapping
     private String remapName(String name) {
         if (name == null) {
             return name;

Deleted: sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/util/ConcurrentHashSet.java
===================================================================
--- sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/util/ConcurrentHashSet.java	2010-08-10 17:53:21 UTC (rev 18539)
+++ sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/util/ConcurrentHashSet.java	2010-08-10 18:16:55 UTC (rev 18540)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.cdk.util;
-
-import java.util.AbstractSet;
-import java.util.Iterator;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-/**
- * @author Nick Belaevski
- * 
- */
-public class ConcurrentHashSet<E> extends AbstractSet<E> {
-
-    private ConcurrentMap<E, Boolean> backingMap = new ConcurrentHashMap<E, Boolean>();
-
-    @Override
-    public Iterator<E> iterator() {
-        return backingMap.keySet().iterator();
-    }
-
-    public boolean add(E e) {
-        return backingMap.put(e, Boolean.TRUE) == null;
-    }
-    
-    public boolean addIfAbsent(E e) {
-        return backingMap.putIfAbsent(e, Boolean.TRUE) == null;
-    }
-    
-    @Override
-    public boolean contains(Object o) {
-        return backingMap.containsKey(o);
-    }
-    
-    @Override
-    public boolean remove(Object o) {
-        return Boolean.TRUE.equals(backingMap.remove(o));
-    }
-    
-    @Override
-    public void clear() {
-        backingMap.clear();
-    }
-    
-    @Override
-    public int size() {
-        return backingMap.size();
-    }
-    
-    @Override
-    public boolean isEmpty() {
-        return backingMap.isEmpty();
-    }
-    
-}
\ No newline at end of file

Modified: sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipVFSFile.java
===================================================================
--- sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipVFSFile.java	2010-08-10 17:53:21 UTC (rev 18539)
+++ sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipVFSFile.java	2010-08-10 18:16:55 UTC (rev 18540)
@@ -68,9 +68,7 @@
     public InputStream getInputStream() throws IOException {
         ZipEntry entry = zipNode.getZipEntry();
         if (entry != null) {
-            synchronized (zipFile) {
-                return zipFile.getInputStream(entry);
-            }
+            return zipFile.getInputStream(entry);
         }
 
         throw new IOException("Input stream isn't available!");



More information about the richfaces-svn-commits mailing list