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); } } }
public PreprocessResource(Processor processor, Resource r) { super(r.lastModified()); this.processor = processor; this.resource = r; setExtra(resource.getExtra()); }
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); } } }
public PreprocessResource(Processor processor, Resource r) { super(r.lastModified()); this.processor = processor; this.resource = r; setExtra(resource.getExtra()); }
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); } } }
public PreprocessResource(Processor processor, Resource r) { super(r.lastModified()); this.processor = processor; this.resource = r; setExtra(resource.getExtra()); }
Resource resource = new FileResource(from); if (preprocess != null && preprocess.matches(path)) { resource = new PreprocessResource(this, resource);
public PreprocessResource(Processor processor, Resource r) { super(r.lastModified()); this.processor = processor; this.resource = r; setExtra(resource.getExtra()); }
Resource resource = new FileResource(from); if (preprocess != null && preprocess.matches(path)) { resource = new PreprocessResource(this, resource);
public PreprocessResource(Processor processor, Resource r) { super(r.lastModified()); this.processor = processor; this.resource = r; setExtra(resource.getExtra()); }
/** * Cop * * @param dest * @param srce * @param path * @param overwriteResource */ private void copy(Jar dest, Jar srce, String path, boolean overwrite) { logger.debug("copy d={} s={} p={}", dest, srce, path); dest.copy(srce, path, overwrite); if (hasSources()) dest.copy(srce, "OSGI-OPT/src/" + path, overwrite); // bnd.info sources must be preprocessed String bndInfoPath = path + "/bnd.info"; Resource r = dest.getResource(bndInfoPath); if (r != null && !(r instanceof PreprocessResource)) { logger.debug("preprocessing bnd.info"); PreprocessResource pp = new PreprocessResource(this, r); dest.putResource(bndInfoPath, pp); } if (hasSources()) { String srcPath = "OSGI-OPT/src/" + path; Map<String, Resource> srcContents = srce.getDirectories() .get(srcPath); if (srcContents != null) { dest.addDirectory(srcContents, overwrite); } } }
/** * Cop * * @param dest * @param srce * @param path * @param overwriteResource */ private void copy(Jar dest, Jar srce, String path, boolean overwrite) { logger.debug("copy d={} s={} p={}", dest, srce, path); dest.copy(srce, path, overwrite); if (hasSources()) dest.copy(srce, "OSGI-OPT/src/" + path, overwrite); // bnd.info sources must be preprocessed String bndInfoPath = path + "/bnd.info"; Resource r = dest.getResource(bndInfoPath); if (r != null && !(r instanceof PreprocessResource)) { logger.debug("preprocessing bnd.info"); PreprocessResource pp = new PreprocessResource(this, r); dest.putResource(bndInfoPath, pp); } if (hasSources()) { String srcPath = "OSGI-OPT/src/" + path; Map<String, Resource> srcContents = srce.getDirectories() .get(srcPath); if (srcContents != null) { dest.addDirectory(srcContents, overwrite); } } }
r = new PreprocessResource(this, r);
/** * Cop * * @param dest * @param srce * @param path * @param overwriteResource */ private void copy(Jar dest, Jar srce, String path, boolean overwrite) { trace("copy d=" + dest + " s=" + srce + " p=" + path); dest.copy(srce, path, overwrite); // bnd.info sources must be preprocessed String bndInfoPath = path + "/bnd.info"; Resource r = dest.getResource(bndInfoPath); if (r != null && !(r instanceof PreprocessResource)) { trace("preprocessing bnd.info"); PreprocessResource pp = new PreprocessResource(this, r); dest.putResource(bndInfoPath, pp); } if (hasSources()) { String srcPath = "OSGI-OPT/src/" + path; Map<String,Resource> srcContents = srce.getDirectories().get(srcPath); if (srcContents != null) { dest.addDirectory(srcContents, overwrite); } } }
/** * Cop * * @param dest * @param srce * @param path * @param overwriteResource */ private void copy(Jar dest, Jar srce, String path, boolean overwrite) { trace("copy d=" + dest + " s=" + srce +" p="+ path); dest.copy(srce, path, overwrite); // bnd.info sources must be preprocessed String bndInfoPath = path + "/bnd.info"; Resource r = dest.getResource(bndInfoPath); if ( r != null && !(r instanceof PreprocessResource)) { trace("preprocessing bnd.info"); PreprocessResource pp = new PreprocessResource(this, r); dest.putResource(bndInfoPath, pp); } if (hasSources()) { String srcPath = "OSGI-OPT/src/" + path; Map<String,Resource> srcContents = srce.getDirectories().get(srcPath); if (srcContents != null) { dest.addDirectory(srcContents, overwrite); } } }
/** * Cop * * @param dest * @param srce * @param path * @param overwriteResource */ private void copy(Jar dest, Jar srce, String path, boolean overwrite) { trace("copy d=" + dest + " s=" + srce + " p=" + path); dest.copy(srce, path, overwrite); // bnd.info sources must be preprocessed String bndInfoPath = path + "/bnd.info"; Resource r = dest.getResource(bndInfoPath); if (r != null && !(r instanceof PreprocessResource)) { trace("preprocessing bnd.info"); PreprocessResource pp = new PreprocessResource(this, r); dest.putResource(bndInfoPath, pp); } if (hasSources()) { String srcPath = "OSGI-OPT/src/" + path; Map<String,Resource> srcContents = srce.getDirectories().get(srcPath); if (srcContents != null) { dest.addDirectory(srcContents, overwrite); } } }
r = new PreprocessResource(this, r);
r = new PreprocessResource(this, r);
r = new PreprocessResource(this, r);
r = new PreprocessResource(this, r);