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

XOAI wrong URL encoding

    XMLWordPrintable

    Details

    • Attachments:
      0
    • Comments:
      5
    • Documentation Status:
      Not Required

      Description

      Having bitstream with name which contain e.g. a blank the encoding of the resulting URL in a metadataFormat which exposes the bitstream URL like MODS
      is wrong:
      e.g.
      <premis:objectIdentifierType>URL</premis:objectIdentifierType>
      <premis:objectIdentifierValue>http://localhost:8080/dspaceMaster/bitstream/123456789/4/1/Dummy+File+With+Blanks+In+The+Name.txt</premis:objectIdentifierValue>
      </premis:objectIdentifier>

      it should be
      <premis:objectIdentifier>
      <premis:objectIdentifierType>URL</premis:objectIdentifierType>
      <premis:objectIdentifierValue>http://localhost:8080/dspaceMaster/bitstream/123456789/4/1/Dummy%20File%20With%20Blanks%20In%20The%20Name.txt</premis:objectIdentifierValue>
      </premis:objectIdentifier>

      this is due to the fact that
      [dspace-src]/dspace-oai/src/main/java/org/dspace/xoai/util/URIUtils.java
      uses java.net.URLendoer
      which does application/x-www-form-urlencoding

      an thus the following rules apply (from the doc):
      The alphanumeric characters "a" through "z", "A" through "Z" and "0" through "9" remain the same.
      The special characters ".", "-", "*", and "_" remain the same.
      The space character " " is converted into a plus sign "+".
      All other characters are unsafe and are first converted into one or more bytes using some encoding scheme. Then each byte is represented by the 3-character string "%xy", where xy is the two-digit hexadecimal representation of the byte. The recommended encoding scheme to use is UTF-8. However, for compatibility reasons, if an encoding is not specified, then the default encoding of the platform is used.

        Attachments

          Activity

            People

            Assignee:
            helix84 Ivan Masár
            Reporter:
            cjuergen Claudia Jürgen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: