Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-662

Attachments support in olingo

    XMLWordPrintableJSON

Details

    • Important

    Description

      This question is about the support for attachments uploading and downloading via Olingo Service ( Olingo V2 2.0.3 ). I have gone the olingo docs but didn't find any clue on how to provide support for uploading and downloading of attachments using olingo .

      Does olingo supports this functionality ? If olingo supports , how to implements this ?

      Following are some basics which i came to know by debugging the core library :
      -> Media type support : We can provide support for custom content types by overriding the method getCustomContentTypes() in processor class.
      -> Implementation : we can implement createEntity as following in processor class :

      @Override
      public ODataResponse createEntity(PostUriInfo uriInfo, InputStream content,
      String requestContentType, String contentType) throws ODataException

      { ... }

      But here content is giving the requestBody , not actual file/attachment.

      Note : Here the support for attachments means - ex : in case of Rest , CXF provides some api which can be seen in following snippet :

      @POST
      @Consumes(

      {MediaType.MULTIPART_FORM_DATA }

      )
      @Produces(

      {MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}

      )
      public Response create(@Context HttpHeaders httpHeaders, @Context UriInfo uriInfo,
      MultipartBody multipartBody)

      Here @Consumes media type provides consumption of multipart formdata and MultipartBody parameter can give us the attachments.

      Similar to above , Does Olingo V2 2.0.3 provides any API ?How can we implement the support for attachments in Olingo V2 2.0.3 ? Please share us an example !

      Attachments

        Activity

          People

            chrisam Christian Amend
            prashanthpatha Prashanth
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: