Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-1149

BinaryContentIngester in SWORDv2 creates a new ORIGINALS bundle every time a bitstream is ingested to an Item

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.0, 1.8.1, 1.8.2
    • Fix Version/s: 4.0
    • Component/s: SWORD
    • Labels:
      None
    • Attachments:
      0
    • Comments:
      2
    • Documentation Status:
      Not Required

      Description

      When ingesting an bitstream to an Item (i.e. adding a file to the media resource), BinaryContentIngester creates a new ORIGINAL bundle even if one is already available. Also, it does not set the MIME-type for the bitstream.
      The problem is in BinaryContentIngester, line 138:

      Bundle original = null;

      original is assigned but never used because at lines 148:

      Bitstream bs = item.createSingleBitstream(deposit.getInputStream());

      which creates a new bundle disregarding the original bundle.
      This code should solve the problem, and also add the bitstream format field:

      Bitstream bs = original.createBitstream(deposit.getInputStream());
      BitstreamFormat format = this.getFormat(context,deposit.getFilename());
      bs.setFormat(format);

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              richardjones Richard Jones
              Reporter:
              marcof Marco Fabiani
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: