Uploaded image for project: 'Fedora Repository Project'
  1. Fedora Repository Project
  2. FCREPO-1873

Error occur while using REST API to perform a binary MOVE

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Fedora 4.2.0, Fedora 4.3.0, Fedora 4.4.0
    • Fix Version/s: Fedora 4.5.1
    • Component/s: f4-core
    • Labels:
    • Environment:
    • Roadmap Theme:
      API Specification
    • Sprint:
      Sprint 2015 - 13

      Description

      When trying to move a Binary, from path "/test/image" to "/test/image1", the following error occurs:
      javax.jcr.nodetype.ConstraintViolationException: Unable to add child 'image1' with primary type 'nt:resource' to parent at /test with primary type 'nt:folder' and mixins fedora:Container,fedora:Resource} in workspace 'default' of repository 'repo' because:
       - child's primary type 'nt:resource' does not satisfy parent's child definition: nt:folder/* (required primary types = [nt:hierarchyNode])

      I'm assuming, by reading the REST API documentation (https://wiki.duraspace.org/display/FEDORA4x/RESTful+HTTP+API), that a Binary is a resource as a Container is and therefore should be possible to move (as I have tested and seen working with Containers).

      How to reproduce (using fcrepo-webapp-4.[234].0-jetty-console.jar):
      1) Create container
      $> curl -i -X PUT "http://localhost:8080/rest/test"

      2) Create binary
      $> curl -X PUT --upload-file ~/Desktop/JavaSE6\ HotSpotVirtualMachineHeapByGenerationsSchema.png -H"Content-Type: image/png" "http://localhost:8080/rest/test/image"

      3) Move binary (i.e. rename it in this case)
      $> curl -X MOVE -H "Destination: http://localhost:8080/rest/test/image1" "http://localhost:8080/rest/test/image"

        Attachments

          Activity

            People

            • Assignee:
              esc Esmé Cowles
              Reporter:
              hsilva Hélder Silva
              Reviewer:
              Andrew Woods
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: