@Override public void run() { try { try (Jar src = new Jar(sources)) { try (Jar bin = new Jar(binary)) { bin.setDoNotTouchManifest(); for (String path : src.getResources() .keySet()) bin.putResource("OSGI-OPT/src/" + path, src.getResource(path)); bin.write(out); } out.setLastModified(System.currentTimeMillis()); } } catch (Exception e) { throw Exceptions.duck(e); } } });
@Override public void run() { try { try (Jar src = new Jar(sources)) { try (Jar bin = new Jar(binary)) { bin.setDoNotTouchManifest(); for (String path : src.getResources() .keySet()) bin.putResource("OSGI-OPT/src/" + path, src.getResource(path)); bin.write(out); } out.setLastModified(System.currentTimeMillis()); } } catch (Exception e) { throw Exceptions.duck(e); } } });
if (f.exists()) { Jar jar = new Jar(f); jar.setDoNotTouchManifest(); addClose(jar); String path = "WEB-INF/lib/" + f.getName();
if (f.exists()) { Jar jar = new Jar(f); jar.setDoNotTouchManifest(); addClose(jar); String path = "WEB-INF/lib/" + f.getName();
if (f.exists()) { Jar jar = new Jar(f); jar.setDoNotTouchManifest(); addClose(jar); String path = "WEB-INF/lib/" + f.getName();
if (f.exists()) { Jar jar = new Jar(f); jar.setDoNotTouchManifest(); buildInstrs.compression() .ifPresent(jar::setCompression);
if (f.exists()) { Jar jar = new Jar(f); jar.setDoNotTouchManifest(); buildInstrs.compression() .ifPresent(jar::setCompression);
@Override public Entry<String, Resource> export(String type, Project project, Map<String, String> options) throws Exception { project.prepare(); Collection<Container> runbundles = project.getRunbundles(); Jar jar = new Jar(project.getName()); jar.setDoNotTouchManifest(); for (Container container : runbundles) { File source = container.getFile(); String path = nonCollidingPath(jar, source.getName()); jar.putResource(path, new FileResource(source)); } return new SimpleEntry<>(jar.getName(), new JarResource(jar, true)); }
private void noSuchFile(Jar jar, String clause, Map<String, String> extra, String source, String destinationPath) throws Exception { List<Jar> src = getJarsFromName(source, Constants.INCLUDE_RESOURCE + " " + source); if (!src.isEmpty()) { for (Jar j : src) { String quoted = j.getSource() != null ? j.getSource() .getName() : j.getName(); // Do not touch the manifest so this also // works for signed files. j.setDoNotTouchManifest(); JarResource jarResource = new JarResource(j); String path = destinationPath.replace(source, quoted); logger.debug("copy d={} s={} path={}", jar, j, path); copy(jar, path, jarResource, extra); } } else { Resource lastChance = make.process(source); if (lastChance != null) { String x = extra.get("extra"); if (x != null) lastChance.setExtra(x); copy(jar, destinationPath, lastChance, extra); } else error("Input file does not exist: %s", source).header(source) .context(clause); } }
private void noSuchFile(Jar jar, String clause, Map<String, String> extra, String source, String destinationPath) throws Exception { List<Jar> src = getJarsFromName(source, Constants.INCLUDE_RESOURCE + " " + source); if (!src.isEmpty()) { for (Jar j : src) { String quoted = j.getSource() != null ? j.getSource() .getName() : j.getName(); // Do not touch the manifest so this also // works for signed files. j.setDoNotTouchManifest(); JarResource jarResource = new JarResource(j); String path = destinationPath.replace(source, quoted); logger.debug("copy d={} s={} path={}", jar, j, path); copy(jar, path, jarResource, extra); } } else { Resource lastChance = make.process(source); if (lastChance != null) { String x = extra.get("extra"); if (x != null) lastChance.setExtra(x); copy(jar, destinationPath, lastChance, extra); } else error("Input file does not exist: %s", source).header(source) .context(clause); } }
@Override public Entry<String, Resource> export(String type, Project project, Map<String, String> options) throws Exception { project.prepare(); Collection<Container> runbundles = project.getRunbundles(); Jar jar = new Jar(project.getName()); jar.setDoNotTouchManifest(); for (Container container : runbundles) { File source = container.getFile(); String path = nonCollidingPath(jar, source.getName()); jar.putResource(path, new FileResource(source)); } return new SimpleEntry<>(jar.getName(), new JarResource(jar, true)); }
private void noSuchFile(Jar jar, @SuppressWarnings("unused") String clause, Map<String,String> extra, String source, String destinationPath) throws Exception { Jar src = getJarFromName(source, "Include-Resource " + source); if (src != null) { // Do not touch the manifest so this also // works for signed files. src.setDoNotTouchManifest(); JarResource jarResource = new JarResource(src); jar.putResource(destinationPath, jarResource); } else { Resource lastChance = make.process(source); if (lastChance != null) { String x = extra.get("extra"); if (x != null) lastChance.setExtra(x); jar.putResource(destinationPath, lastChance); } else error("Input file does not exist: " + source); } }
private void noSuchFile(Jar jar, @SuppressWarnings("unused") String clause, Map<String,String> extra, String source, String destinationPath) throws Exception { Jar src = getJarFromName(source, Constants.INCLUDE_RESOURCE + " " + source); if (src != null) { // Do not touch the manifest so this also // works for signed files. src.setDoNotTouchManifest(); JarResource jarResource = new JarResource(src); jar.putResource(destinationPath, jarResource); } else { Resource lastChance = make.process(source); if (lastChance != null) { String x = extra.get("extra"); if (x != null) lastChance.setExtra(x); jar.putResource(destinationPath, lastChance); } else error("Input file does not exist: " + source); } }
private void noSuchFile(Jar jar, @SuppressWarnings("unused") String clause, Map<String,String> extra, String source, String destinationPath) throws Exception { Jar src = getJarFromName(source, Constants.INCLUDE_RESOURCE + " " + source); if (src != null) { // Do not touch the manifest so this also // works for signed files. src.setDoNotTouchManifest(); JarResource jarResource = new JarResource(src); jar.putResource(destinationPath, jarResource); } else { Resource lastChance = make.process(source); if (lastChance != null) { String x = extra.get("extra"); if (x != null) lastChance.setExtra(x); jar.putResource(destinationPath, lastChance); } else error("Input file does not exist: " + source); } }
dot.setManifest(manifest); else dot.setDoNotTouchManifest();