@Override protected void initInternal() throws LifecycleException { try (JarFile warFile = new JarFile(getBase())) { JarEntry jarFileInWar = warFile.getJarEntry(archivePath); InputStream jarFileIs = warFile.getInputStream(jarFileInWar); try (JarInputStream jarIs = new JarInputStream(jarFileIs)) { setManifest(jarIs.getManifest()); } } catch (IOException ioe) { throw new IllegalArgumentException(ioe); } try { setBaseUrl(UriUtil.buildJarSafeUrl(new File(getBase()))); } catch (MalformedURLException e) { throw new IllegalArgumentException(e); } }
@Override protected WebResource createArchiveResource(JarEntry jarEntry, String webAppPath, Manifest manifest) { return new JarWarResource(getRoot(), webAppPath, getBase(), getBaseUrlString(), jarEntry, archivePath, getInternalPath(), manifest); }
@Override protected void initInternal() throws LifecycleException { try (JarFile warFile = new JarFile(getBase())) { JarEntry jarFileInWar = warFile.getJarEntry(archivePath); InputStream jarFileIs = warFile.getInputStream(jarFileInWar); try (JarInputStream jarIs = new JarInputStream(jarFileIs)) { setManifest(jarIs.getManifest()); } } catch (IOException ioe) { throw new IllegalArgumentException(ioe); } try { setBaseUrl(UriUtil.buildJarSafeUrl(new File(getBase()))); } catch (MalformedURLException e) { throw new IllegalArgumentException(e); } }
@Override protected void initInternal() throws LifecycleException { try (JarFile warFile = new JarFile(getBase())) { JarEntry jarFileInWar = warFile.getJarEntry(archivePath); InputStream jarFileIs = warFile.getInputStream(jarFileInWar); try (JarInputStream jarIs = new JarInputStream(jarFileIs)) { JarEntry entry = jarIs.getNextJarEntry(); while (entry != null) { getJarFileEntries().put(entry.getName(), entry); entry = jarIs.getNextJarEntry(); } setManifest(jarIs.getManifest()); } } catch (IOException ioe) { throw new IllegalArgumentException(ioe); } try { setBaseUrl((new File(getBase())).toURI().toURL()); } catch (MalformedURLException e) { throw new IllegalArgumentException(e); } } }