/** * Create an instance of {@link MIMETypedStream } * */ public MIMETypedStream createMIMETypedStream() { return new MIMETypedStream(); }
public static org.fcrepo.server.types.gen.MIMETypedStream convertMIMETypedStreamToGenMIMETypedStream(org.fcrepo.server.storage.types.MIMETypedStream mimeTypedStream) { if (mimeTypedStream != null) { org.fcrepo.server.types.gen.MIMETypedStream genMIMETypedStream = new org.fcrepo.server.types.gen.MIMETypedStream(); genMIMETypedStream.setMIMEType(mimeTypedStream.getMIMEType()); org.fcrepo.server.storage.types.Property[] header = mimeTypedStream.header; org.fcrepo.server.types.gen.MIMETypedStream.Header head = new org.fcrepo.server.types.gen.MIMETypedStream.Header(); if (header != null) { for (org.fcrepo.server.storage.types.Property property : header) { head.getProperty() .add(convertPropertyToGenProperty(property)); } } genMIMETypedStream.setHeader(head); try{ genMIMETypedStream.setStream( StreamUtility.getBytes(mimeTypedStream.getStream())); } catch (IOException ioe) { logger.error("Error converting types", ioe); } return genMIMETypedStream; } else { return null; } }
String dsLocation = "http://local.fedora.server/fedora/objects/fedora-system:ContentModel-3.0/datastreams/DC/content"; org.fcrepo.server.types.gen.MIMETypedStream dc_content = apia.getDatastreamDissemination("fedora-system:ContentModel-3.0", "DC", null); String checksum = computeChecksum(checksumType, new ByteArrayInputStream(dc_content.getStream())); String dsId = addDatastream(pid, dsLocation, checksumType, checksum); assertEquals("DS", dsId);
public static org.fcrepo.server.types.gen.MIMETypedStream convertMIMETypedStreamToGenMIMETypedStream(org.fcrepo.server.storage.types.MIMETypedStream mimeTypedStream) { if (mimeTypedStream != null) { org.fcrepo.server.types.gen.MIMETypedStream genMIMETypedStream = new org.fcrepo.server.types.gen.MIMETypedStream(); genMIMETypedStream.setMIMEType(mimeTypedStream.getMIMEType()); org.fcrepo.server.storage.types.Property[] header = mimeTypedStream.header; org.fcrepo.server.types.gen.MIMETypedStream.Header head = new org.fcrepo.server.types.gen.MIMETypedStream.Header(); if (header != null) { for (org.fcrepo.server.storage.types.Property property : header) { head.getProperty() .add(convertPropertyToGenProperty(property)); } } genMIMETypedStream.setHeader(head); try{ genMIMETypedStream.setStream( StreamUtility.getBytes(mimeTypedStream.getStream())); } catch (IOException ioe) { logger.error("Error converting types", ioe); } return genMIMETypedStream; } else { return null; } }
/** * Create an instance of {@link MIMETypedStream } * */ public MIMETypedStream createMIMETypedStream() { return new MIMETypedStream(); }