private Foxml11Document createFoxmlObject(String spid, String contentLocation) throws Exception {
PID pid = PID.getInstance(spid);
Date date = new Date(1);
Foxml11Document doc = new Foxml11Document(pid.toString());
doc.addObjectProperty(Property.STATE, "A");
if (contentLocation != null && contentLocation.length() > 0) {
String ds = "DS";
String dsv = "DS1.0";
doc.addDatastream(ds, State.A, ControlGroup.E, true);
doc.addDatastreamVersion(ds, dsv, "text/plain", "label", 1, date);
doc.setContentLocation(dsv, contentLocation, org.fcrepo.server.storage.types.Datastream.DS_LOCATION_TYPE_URL);
}
return doc;
}