@Test public void testSetDatastreamProfile() throws Exception { LocalStorage storage = new LocalStorage(); LocalObject lobject = storage.create(); String dsID = "dsID"; MediaType mime = MediaType.TEXT_PLAIN_TYPE; String label = "label"; XmlStreamEditor editor = lobject.getEditor(FoxmlUtils.managedProfile(dsID, mime, label)); assertNotNull(editor); assertNotNull(editor.getProfile()); assertEquals(mime.toString(), editor.getProfile().getDsMIME()); assertNull(editor.getProfile().getDsFormatURI()); byte[] data = "data".getBytes("UTF-8"); File attachment = tmp.newFile(); editor.write(attachment.toURI(), 0, null); editor.write(new ByteArrayInputStream(data), editor.getLastModified(), null); lobject.flush(); editor = lobject.getEditor(FoxmlUtils.managedProfile(dsID, mime, label)); String expectedMimetype = MediaType.APPLICATION_JSON; DatastreamProfile profile = editor.getProfile(); profile.setDsMIME(expectedMimetype); editor.setProfile(profile); editor.write(data, editor.getLastModified(), label); lobject.flush(); editor = lobject.getEditor(FoxmlUtils.managedProfile(dsID, mime, label)); assertEquals(expectedMimetype, editor.getProfile().getDsMIME()); }
public LocalObject create() { return create((String) null, null); }
LocalStorage { public LocalObject create() { return create((String) null, null); } }
LocalStorage { public LocalObject create() { return create((String) null, null); }  }
LocalStorage { public LocalObject create() { return create((String) null, null); }  LocalObject load(String pid, File foxml); LocalObject create(); LocalObject create(String pid); LocalObject create(DigitalObject dobj); LocalObject create(File foxml, DigitalObject dobj); LocalObject create(File foxml); LocalObject create(String pid, File foxml); }
LocalStorage { public LocalObject create() { return create((String) null, null); }  LocalObject load(String pid, File foxml); LocalObject create(); LocalObject create(String pid); LocalObject create(DigitalObject dobj); LocalObject create(File foxml, DigitalObject dobj); LocalObject create(File foxml); LocalObject create(String pid, File foxml);  }