File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
web-urlhandler/src/main/java/org/apache/aries/web/url Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 4848 <org .apache.aries.util.version>1.2.0-SNAPSHOT</org .apache.aries.util.version>
4949 <org .apache.aries.web.urlhandler.version>1.0.1-SNAPSHOT</org .apache.aries.web.urlhandler.version>
5050 <org .apache.felix.configadmin.version>1.9.26</org .apache.felix.configadmin.version>
51- <org .eclipse.osgi.version>3.17 .0</org .eclipse.osgi.version>
51+ <org .eclipse.osgi.version>3.22 .0</org .eclipse.osgi.version>
5252 <tinybundles .version>2.1.1</tinybundles .version>
5353 <url .version>2.5.3</url .version>
5454 </properties >
Original file line number Diff line number Diff line change 1818 */
1919package org .apache .aries .web .url ;
2020
21+ import java .io .File ;
2122import java .io .IOException ;
2223import java .net .URL ;
2324import java .net .URLConnection ;
25+ import java .nio .file .Files ;
26+ import java .nio .file .StandardCopyOption ;
2427import java .util .Dictionary ;
2528import java .util .Hashtable ;
2629import java .util .StringTokenizer ;
@@ -69,8 +72,14 @@ public URLConnection openConnection(URL url) throws IOException
6972 firstProperty = false ;
7073 }
7174 }
72-
73- return new WARConnection (new URL (url .getPath ()), properties );
75+ WARConnection warConnection = new WARConnection (new URL (url .getPath ()), properties );
76+ // in new version of org.eclipse.osgi > 3.17.0 we cannot return war connection
77+ // since when its protocol is file then generated input stream is ignored
78+ // and framework reads file again
79+ // https://github.com/eclipse-equinox/equinox/blob/e35221a86afd24ee21b7b9d02db298a90ace1bc0/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java#L1158-L1181
80+ File webbundle = File .createTempFile ("webbundle" , ".wab" );
81+ Files .copy (warConnection .getInputStream (), webbundle .toPath (), StandardCopyOption .REPLACE_EXISTING );
82+ return webbundle .getAbsoluteFile ().toURI ().toURL ().openConnection ();
7483 }
7584
7685 @ Override
You can’t perform that action at this time.
0 commit comments