if(extension != null) {
ai.updateFormat(extension);
}
ai.updateBinaryContentAttachment(is);
ai.getPackage().updateBinaryUpToDate(false);
ai.checkin("update binary");
repository.save();
return ToAssetEntryAbdera(ai, uriInfo);
} catch (Exception e) {
//catch RulesRepositoryException and other exceptions. For example when the package already exists.
throw new WebApplicationException(e);