Author: cziegeler
Date: Tue Jan 18 08:25:30 2011
New Revision: 1060235

URL: http://svn.apache.org/viewvc?rev=1060235&view=rev
Log:
Some fixes for the resource handling

Modified:
    
felix/sandbox/cziegeler/maven-dp-plugin/src/main/java/org/apache/felix/maven/dp/ResourceCollector.java

Modified: 
felix/sandbox/cziegeler/maven-dp-plugin/src/main/java/org/apache/felix/maven/dp/ResourceCollector.java
URL: 
http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-dp-plugin/src/main/java/org/apache/felix/maven/dp/ResourceCollector.java?rev=1060235&r1=1060234&r2=1060235&view=diff
==============================================================================
--- 
felix/sandbox/cziegeler/maven-dp-plugin/src/main/java/org/apache/felix/maven/dp/ResourceCollector.java
 (original)
+++ 
felix/sandbox/cziegeler/maven-dp-plugin/src/main/java/org/apache/felix/maven/dp/ResourceCollector.java
 Tue Jan 18 08:25:30 2011
@@ -75,7 +75,9 @@ public class ResourceCollector {
                     for(int m=0; m<files.length; m++) {
                         this.getLog().debug("Found resource " + files[m]);
                         // get processor identifier from path
-                        final String relPath = 
files[m].substring(dir.getAbsolutePath().length() + 1);
+                        final String relPath =
+                            (files[m].startsWith(dir.getAbsolutePath())
+                             ? 
files[m].substring(dir.getAbsolutePath().length() + 1) : files[m]);
                         final int pos = relPath.indexOf(File.separatorChar);
                         final String processorId = relPath.substring(0, pos);
 
@@ -90,7 +92,7 @@ public class ResourceCollector {
                             processor = processorId;
                         }
                         this.getLog().debug("  Processor for " + files[m] + " 
is " + processor);
-                        pck.addProcessorResource(new ProcessorResource(new 
File(files[m]), processor, relPath));
+                        pck.addProcessorResource(new ProcessorResource(new 
File(dir, files[m]), processor, relPath));
                     }
                 }
 


Reply via email to