public class MobileAppDownloader
Downloads an http(s):// appFile reference to a local temp file before AAB
detection/conversion. Deliberately does not read user-configured proxy preferences — those
live in a composer-layer bundle that core.mobile must not depend on (would create a layering
violation); falls back to the JVM's default proxy handling (system properties) instead.
httpClient is @Injected via ExecutionServiceContext — the same
registry ExecutionMain.injectCommonServices() populates with ApacheHttpClient
for a test run — rather than obtained through ApacheHttpClient.getInstance() directly.
That method resolves its bundle via FrameworkUtil.getBundle(...), which requires an
active OSGi framework; a test case executes in a separate, non-OSGi process, where that lookup
always returns null and throws
(NullPointerException: Cannot invoke "Bundle.getBundleContext()" because the return
value of "FrameworkUtil.getBundle(Class)" is null). ExecutionServiceContext is the
execution process's own lightweight DI registry and works there regardless of OSGi. Since this
class is constructed with a plain new, not through the DI container itself, the no-arg
constructor triggers the injection explicitly via
ExecutionServiceContext#injectDependencies(Object)#injectDependencies(Object).
| Constructor and description |
|---|
MobileAppDownloader
() |
MobileAppDownloader
(IHttpClient httpClient) |
Downloads url to a new temporary file. The caller owns the returned file and is
responsible for deleting it once no longer needed.