FELIX-423: fix OBR PathFile to encode spaces on all platforms, not just Windows and return absolute path when the basedir is not related to the file (instead of returning null which gets appended to various strings without checking)

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@596259 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/PathFile.java b/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/PathFile.java
index 433b6d5..68cbbf3 100644
--- a/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/PathFile.java
+++ b/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/PathFile.java
@@ -256,9 +256,10 @@
         String path = PathFile.uniformSeparator(getAbsoluteFilename());

         if (File.separatorChar == '\\') { 

         	path = path.replace('\\', '/');

-        	path = path.replaceAll(" ", "%20");

         }

 

+        path = path.replaceAll(" ", "%20");

+

         URI uri = null;

         try {

             uri = new URI(path);

@@ -300,7 +301,7 @@
                     return "." + File.separator + m_pathFile.substring(m_baseDir.length());

                 }

             }

-            return null;

+            return m_pathFile;

         }

     }