code: static BundleFile installBundle(Config config, Resource resJar, String extVersion, boolean convert2bundle) throws IOException, BundleException {
  
  	BundleFile bf = new BundleFile(resJar);
  
  	// resJar is a bundle
  	if (bf.isBundle()) {
  	    return installBundle(config, bf);
  	}
  
  	if (!convert2bundle) return null;
  
  	// name
  	String name = bf.getSymbolicName();
  	if (StringUtil.isEmpty(name)) name = BundleBuilderFactory.createSymbolicName(resJar);
  
  	// version
  	Version version = bf.getVersion();
  	if (version == null) version = OSGiUtil.toVersion(extVersion);
  
  	SystemOut.printDate("failed to load [" + resJar + "] as OSGi Bundle");
  	BundleBuilderFactory bbf = new BundleBuilderFactory(resJar, name);
  	bbf.setVersion(version);
  	bbf.setIgnoreExistingManifest(false);
  	bbf.build();
  
  	bf = new BundleFile(resJar);
  	SystemOut.printDate("converted  [" + resJar + "] to an OSGi Bundle");
  	return installBundle(config, bf);
      }
docs: /*
  important! returns null when not a bundle!