// create the an item in the workspace. This is necessary, because later
// we are going to ask a package ingester to /replace/ this item, which gives
// us finer control over the workflow state of the item, whereas asking
// the ingester to /create/ this item causes it to be injected into the workflow,
// irrespective of the In-Progress header provided by the depositor
WorkspaceItem wsi = WorkspaceItem.create(context, collection, true);
Item item = wsi.getItem();
// need to add a licence file, otherwise the METS replace function raises a NullPointerException
String licence = collection.getLicense();
if (PackageUtils.findDepositLicense(context, item) == null)
{