@Override public BitstreamFormat getFormat(Context context, Bitstream bitstream) throws SQLException { if (bitstream.getBitstreamFormat() == null) { return bitstreamFormatService.findUnknown(context); } else { return bitstream.getBitstreamFormat(); } }
@Override public void setFormat(Context context, Bitstream bitstream, BitstreamFormat bitstreamFormat) throws SQLException { // FIXME: Would be better if this didn't throw an SQLException, // but we need to find the unknown format! if (bitstreamFormat == null) { // Use "Unknown" format bitstreamFormat = bitstreamFormatService.findUnknown(context); } // Remove user type description clearMetadata(context, bitstream, MetadataSchema.DC_SCHEMA, "format", null, Item.ANY); // Update the ID in the table row bitstream.setFormat(bitstreamFormat); }
BitstreamFormat unknownFormat = bitstreamFormatService.findUnknown(context);
BitstreamFormat unknownFormat = bitstreamFormatService.findUnknown(context); bitstreamService.setFormat(context, dspaceBitstream, unknownFormat); } else {
dspaceBitstream.setFormat(context, bitstreamFormatService.findUnknown(context)); } else { bitstreamService.setFormat(context, dspaceBitstream, bitstreamFormatService