in src/main/java/org/apache/commons/mail/HtmlEmail.java [425:445]
public String embed(final DataSource dataSource, final String name) throws EmailException
{
// check if the DataSource has already been attached;
// if so, return the cached CID value.
final InlineImage ii = inlineEmbeds.get(name);
if (ii != null)
{
// make sure the supplied URL points to the same thing
// as the one already associated with this name.
if (dataSource.equals(ii.getDataSource()))
{
return ii.getCid();
}
throw new EmailException("embedded DataSource '" + name
+ "' is already bound to name " + ii.getDataSource().toString()
+ "; existing names cannot be rebound");
}
final String cid = EmailUtils.randomAlphabetic(HtmlEmail.CID_LENGTH).toLowerCase();
return embed(dataSource, name, cid);
}