1

I want to upload a File to my Apache ISIS Webserver. At the moment I convert the File to a String first and send this String to the RESTService. But I figured out that Apache ISIS allocates a lot of java memory space for each of the Strings (the Files are about 40MB).

No I want to know, if I can send my File via InputStream or something other to DO NOT allocate so much of memoryspace, rather than saving the file directly to a temporary location.

Is this possible somehow?

Thanks in advice

riedelinho
  • 404
  • 1
  • 5
  • 15

1 Answers1

1

You could use a Blob ValueType property of a DomainObject:

http://isis.apache.org/guides/rgcms.html#_rgcms_classes_value-types_Blob

and use the regular RestfulObjects viewer support for setting the property value:

http://markmail.org/message/luwajq3tdoxdhnft

- in the RO viewer, invoke:

http://localhost:8080/restful/objects/BLOBCLOB/0/actions/updateSomeImage/invoke

with body set to:

{
   "blob": {
      "value":
       "Amelie-0-flowers.jpg:image/jpeg:/9j/4AAQSkZJRgABAQEASABIAAD//gAcY21wMy4xMC4zLjFMcTMgMHg0NmE5YmE5ZgD..."
   }
}

HTH

Kambiz