buf.append(XMLHelpers.emitTag("bundle-uuid", bgroup + ":" + bname + ":" + bversion + ":"));
buf.append(XMLHelpers.emitTag("bundle-uuid", bgroup + ":" + bname + ":" + bversion + ":", 1));
    protected void generateOBR(File file) throws IOException    {        StringBuffer buf = new StringBuffer();        String description = null;        String md5;        if (file == null)        {            md5 = MD5.getHashString(new File(bundledir + File.separatorChar + bname + "-" + bversion + ".jar"));        } else        {            md5 = MD5.getHashString(file);        }        Vector dependencies = new Vector();        if (thirdparty || file == null)        {            // defaults for thirdparty            description = new String("thirdparty-jar " + bname);            sourceUrl = new String("unknown");            docUrl = new String("unknown");        } else        {            BufferedReader breader = new BufferedReader(new FileReader(new File(bundledir + File.separatorChar + ".."                    + File.separatorChar + "project.xml")));            String line = breader.readLine();            // parse project.xml            while (line != null)            {                if (line.indexOf("shortDescription") > -1)                {                    description = XMLHelpers.getTagContent(breader, line, "shortDescription");                }                if (line.indexOf("dependency") > -1)                {                    String dependency = XMLHelpers.getTagContent(breader, line, "dependency");                    dependencies.add(XMLHelpers.getTagContent(dependency, "artifactId"));                    dependencies.add(XMLHelpers.getTagContent(dependency, "groupId"));                    String version = XMLHelpers.getTagContent(dependency, "version");                    if (version.equals("${pom.currentVersion}"))                    {                        version = bversion;                    }                    dependencies.add(version);                }                line = breader.readLine();            }//            sourceUrl = new String("unknown");//            docUrl = new String("unknown");        }        // set up OBR file        buf.append("<bundle>\n");        buf.append(XMLHelpers.emitTag("bundle-name", bname, 1));        buf.append(XMLHelpers.emitTag("bundle-group", bgroup, 1));        buf.append(XMLHelpers.emitTag("bundle-version", bversion, 1));        // ok the uuid is repition, but to be compatible with knopflerfish        buf.append(XMLHelpers.emitTag("bundle-uuid", bgroup + ":" + bname + ":" + bversion + ":"));        buf.append(XMLHelpers.emitMultilineTag("bundle-description", description, 1));        if (apivendor == null)            buf.append(XMLHelpers.emitTag("bundle-apivendor", "", 1));        else            buf.append(XMLHelpers.emitTag("bundle-apivendor", apivendor, 1));        buf.append(XMLHelpers.emitTag("bundle-vendor", vendor, 1));        // Jan, do we still need the update-location element??        buf.append(XMLHelpers.emitTag("update-location", "localhost://" + repolocal, 1));                String bundlepath = bgroup + "/jars/" + bname + "-" + bversion + ".jar";        if (updatelocation == null)            buf.append(XMLHelpers.emitTag("bundle-updatelocation",                     "http://osgirepo.berlios.de/maven/repository/" + bundlepath, 1));        else            buf.append(XMLHelpers.emitTag("bundle-updatelocation",                     updatelocation +"/"+ bundlepath, 1));                buf.append(XMLHelpers.emitMultilineTag("bundle-sourceurl", sourceUrl, 1));        buf.append(XMLHelpers.emitMultilineTag("bundle-docurl", docUrl, 1));                if (category != null)            buf.append(XMLHelpers.emitTag("bundle-category", category, 1));        else            buf.append(XMLHelpers.emitTag("bundle-category", "general", 1));                buf.append(XMLHelpers.emitTag("bundle-checksum", md5, 1));        for (Iterator iter = importSet.iterator(); iter.hasNext();)        {            buf.append("\t<import-package package=\"" + iter.next() + "\"/>\n");        }                for (Iterator iterexp = exportSet.iterator(); iterexp.hasNext();)        {            buf.append("\t<export-package package=\"" + iterexp.next() + "\"/>\n");        }        if (!dependencies.isEmpty())        {            for (Enumeration en = dependencies.elements(); en.hasMoreElements();)            {                String depname = (String) en.nextElement();                String depgroup = (String) en.nextElement();                String depversion = (String) en.nextElement();                buf.append("\t<dependency-uuid>");                buf.append(depgroup + ":" + depname + ":" + depversion + ":");                buf.append("</dependency-uuid>\n");            }        }        //    	if (!dependencies.isEmpty()) {        //    		buf.append("\t<dependencies>\n");        //    		for (Enumeration en = dependencies.elements(); en.hasMoreElements();        // ) {        //    			buf.append("\t\t<bundle>\n");        //    			buf.append(XMLHelpers.emitTag("bundle-name",        // (String)en.nextElement(), 3));        //				buf.append(XMLHelpers.emitTag("bundle-group",        // (String)en.nextElement(), 3));        //				buf.append(XMLHelpers.emitTag("bundle-version",        // (String)en.nextElement(), 3));        //    			buf.append("\t\t</bundle>\n");        //    		}        //    		buf.append("\t</dependencies>\n");        //    	}        buf.append("</bundle>\n");        // Debug output:        //    	System.out.println("OBR:");        //    	System.out.println(buf.toString());        File obrfile = new File(bundledir + File.separatorChar + bname + "-" + bversion + ".obr");        BufferedWriter bwriter = new BufferedWriter(new FileWriter(obrfile));        bwriter.write(buf.toString());        bwriter.flush();    }