public Bitstream getBitstream(Context context, String location) throws DSpaceSwordException, SwordError { try { String baseUrl = this.getSwordBaseUrl(); String emBaseUrl = baseUrl + "/edit-media/bitstream/"; if (!location.startsWith(emBaseUrl)) { throw new SwordError(DSpaceUriRegistry.BAD_URL, "The bitstream URL is invalid"); } String bitstreamParts = location.substring(emBaseUrl.length()); // the bitstream id is the part up to the first "/" int firstSlash = bitstreamParts.indexOf("/"); String bid = bitstreamParts.substring(0, firstSlash); Bitstream bitstream = bitstreamService.findByIdOrLegacyId(context, bid); return bitstream; } catch (SQLException e) { // log.error("Caught exception:", e); throw new DSpaceSwordException( "There was a problem resolving the collection", e); } }
bsid = bsid.substring(0, url.length() - 1); return bitstreamService.findByIdOrLegacyId(context, bsid); } else { throw new SWORDErrorException(DSpaceSWORDErrorCodes.BAD_URL,
org.dspace.content.Item item = findItem(context, itemId, org.dspace.core.Constants.WRITE); org.dspace.content.Bitstream bitstream = bitstreamService.findByIdOrLegacyId(context, bitstreamId); if (bitstream == null) { context.abort();
org.dspace.content.Bitstream bitstream = null; try { bitstream = bitstreamService.findByIdOrLegacyId(context, id);
if (bundleName == null) { Bitstream bitstream = bitstreamService.findByIdOrLegacyId(context, bitstreamId);
switch (query.getDsoType()) { case Constants.BITSTREAM: Bitstream bit = bitstreamService.findByIdOrLegacyId(context, dsoId); if (bit == null) { break;
switch (query.dsoType) { case Constants.BITSTREAM: Bitstream bit = bitstreamService.findByIdOrLegacyId(context, dsoId); if (bit == null) { break;
for (String id : list) { try { Bitstream bs = bitstreamService.findByIdOrLegacyId(context, id); if (bs == null) { ItemUpdate.pr("Bitstream not found by id: " + id);