Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/web-itests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<org.apache.aries.util.version>1.2.0-SNAPSHOT</org.apache.aries.util.version>
<org.apache.aries.web.urlhandler.version>1.0.1-SNAPSHOT</org.apache.aries.web.urlhandler.version>
<org.apache.felix.configadmin.version>1.9.26</org.apache.felix.configadmin.version>
<org.eclipse.osgi.version>3.17.0</org.eclipse.osgi.version>
<org.eclipse.osgi.version>3.22.0</org.eclipse.osgi.version>
<tinybundles.version>2.1.1</tinybundles.version>
<url.version>2.5.3</url.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
*/
package org.apache.aries.web.url;

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.StringTokenizer;
Expand Down Expand Up @@ -69,8 +72,14 @@ public URLConnection openConnection(URL url) throws IOException
firstProperty = false;
}
}

return new WARConnection(new URL(url.getPath()), properties);
WARConnection warConnection = new WARConnection(new URL(url.getPath()), properties);
// in new version of org.eclipse.osgi > 3.17.0 we cannot return war connection
// since when its protocol is file then generated input stream is ignored
// and framework reads file again
// https://github.com/eclipse-equinox/equinox/blob/e35221a86afd24ee21b7b9d02db298a90ace1bc0/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java#L1158-L1181
File webbundle = File.createTempFile("webbundle", ".wab");
Files.copy(warConnection.getInputStream(), webbundle.toPath(), StandardCopyOption.REPLACE_EXISTING);
return webbundle.getAbsoluteFile().toURI().toURL().openConnection();
}

@Override
Expand Down