String x = extra.get("extra"); if (x != null) r.setExtra(x); jar.putResource(name, r); } else {
String x = extra.get("extra"); if (x != null) r.setExtra(x); jar.putResource(name, r); } else {
String x = extra.get("extra"); if (x != null) r.setExtra(x); jar.putResource(name, r); } else {
String x = extra.get("extra"); if (x != null) r.setExtra(x); copy(jar, name, r, extra); if (preprocess != null) {
private void copy(Jar jar, String path, File from, Instructions preprocess, Map<String, String> extra) throws Exception { if (doNotCopy(from)) return; logger.debug("copy d={} s={} path={}", jar, from, path); if (from.isDirectory()) { File files[] = from.listFiles(); for (int i = 0; i < files.length; i++) { copy(jar, appendPath(path, files[i].getName()), files[i], preprocess, extra); } } else { if (from.exists()) { Resource resource = new FileResource(from); if (preprocess != null && preprocess.matches(path)) { resource = new PreprocessResource(this, resource); } String x = extra.get("extra"); if (x != null) resource.setExtra(x); if (path.endsWith("/")) path = path + from.getName(); copy(jar, path, resource, extra); } else if (from.getName() .equals(Constants.EMPTY_HEADER)) { jar.putResource(path, new EmbeddedResource(new byte[0], 0L)); } else { error("Input file does not exist: %s", from).header(INCLUDERESOURCE + "|" + INCLUDE_RESOURCE); } } }
String x = extra.get("extra"); if (x != null) r.setExtra(x); copy(jar, name, r, extra); if (preprocess != null) {
private void copy(Jar jar, String path, File from, Instructions preprocess, Map<String, String> extra) throws Exception { if (doNotCopy(from)) return; logger.debug("copy d={} s={} path={}", jar, from, path); if (from.isDirectory()) { File files[] = from.listFiles(); for (int i = 0; i < files.length; i++) { copy(jar, appendPath(path, files[i].getName()), files[i], preprocess, extra); } } else { if (from.exists()) { Resource resource = new FileResource(from); if (preprocess != null && preprocess.matches(path)) { resource = new PreprocessResource(this, resource); } String x = extra.get("extra"); if (x != null) resource.setExtra(x); if (path.endsWith("/")) path = path + from.getName(); copy(jar, path, resource, extra); } else if (from.getName() .equals(Constants.EMPTY_HEADER)) { jar.putResource(path, new EmbeddedResource(new byte[0], 0L)); } else { error("Input file does not exist: %s", from).header(INCLUDERESOURCE + "|" + INCLUDE_RESOURCE); } } }
private void copy(Jar jar, String path, File from, boolean preprocess, Map<String,String> extra) throws Exception { if (doNotCopy(from.getName())) return; if (from.isDirectory()) { File files[] = from.listFiles(); for (int i = 0; i < files.length; i++) { copy(jar, appendPath(path, files[i].getName()), files[i], preprocess, extra); } } else { if (from.exists()) { Resource resource = new FileResource(from); if (preprocess) { resource = new PreprocessResource(this, resource); } String x = extra.get("extra"); if (x != null) resource.setExtra(x); if (path.endsWith("/")) path = path + from.getName(); jar.putResource(path, resource); if (isTrue(extra.get(LIB_DIRECTIVE))) { setProperty(BUNDLE_CLASSPATH, append(getProperty(BUNDLE_CLASSPATH), path)); } } else if (from.getName().equals(Constants.EMPTY_HEADER)) { jar.putResource(path, new EmbeddedResource(new byte[0], 0)); } else { error("Input file does not exist: " + from); } } }
resource.setExtra(x); if (path.endsWith("/")) path = path + from.getName();
resource.setExtra(x); if (path.endsWith("/")) path = path + from.getName();
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); } }
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); } }