Fix issue FELIX-1411
On windows system the directory manipulation failed because the collected class files contains \ characters and the internal list contains / characters as path separator.
This is fixed by replacing \ by / during the collection.
The fix was tested on Windows and Mac OS.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@803031 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
index d782455..ec4d04e 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
@@ -227,7 +227,7 @@
// Start the manipulation
manipulateJarFile(out);
-
+
// Check that all declared components are manipulated
for (int i = 0; i < m_components.size(); i++) {
ComponentInfo ci = (ComponentInfo) m_components.get(i);
@@ -457,7 +457,6 @@
* Manipulate classes of the input Jar.
*/
private void manipulateComponents() {
- //Enumeration entries = inputJar.entries();
Enumeration entries = getClassFiles();
while (entries.hasMoreElements()) {
@@ -483,7 +482,7 @@
if (ci.m_classname.equals(curName)) {
byte[] outClazz = manipulateComponent(in, ci);
m_classes.put(ci.m_classname, outClazz);
-
+
// Manipulate inner classes ?
if (!ci.m_inners.isEmpty()) {
for (int k = 0; k < ci.m_inners.size(); k++) {
@@ -605,7 +604,8 @@
*/
private String computeRelativePath(String absolutePath) {
String root = m_dir.getAbsolutePath();
- return absolutePath.substring(root.length() + 1);
+ String path = absolutePath.substring(root.length() + 1);
+ return path.replace("\\", "/"); // To support Windows systems, the \ are replaced by /
}
/**