metadata.setLong(METADATA_ADAPTOR_NEXTID, id);
			public org.eclipse.osgi.framework.adaptor.BundleData begin() throws BundleException			{				long id;				try				{					/*					 * Open InputStream first to trigger prereq installs, if any,					 * before allocating bundle id.					 */					InputStream in = source.getInputStream();					try					{						try						{							id = getNextBundleId();							metadata.setLong(METADATA_ADAPTOR_NEXTID, id);							metadata.save();						}						catch (IOException e)						{							throw new BundleException(AdaptorMsg.formatter.getString("ADAPTOR_STORAGE_EXCEPTION"), e);						}						if (in instanceof ReferenceInputStream)						{							URL reference = ((ReferenceInputStream) in).getReference();							if (!"file".equals(reference.getProtocol()))							{								throw new BundleException(									AdaptorMsg.formatter.getString("ADAPTOR_URL_CREATE_EXCEPTION", reference));							}							data = (DefaultBundleData)getElementFactory().getBundleData(DefaultAdaptor.this);							data.initializeReferencedBundle(id, location, reference.getPath());						}						else						{							data = (DefaultBundleData)getElementFactory().getBundleData(DefaultAdaptor.this);							data.initializeNewBundle(id, location, in);						}					}					finally					{						try						{							in.close();						}						catch (IOException e)						{						}					}				}				catch (IOException ioe)				{					throw new BundleException(AdaptorMsg.formatter.getString("BUNDLE_READ_EXCEPTION"), ioe);				}				return (data);			}