I am not familiar with these modules but if you think something is missing feel free to fix it. ;-)
You can use the FileBlob whenever you have an InputStream or File object as input. If you use an InputStream then the content will be copied into a temporary file - to avoid storing it in memory.

I think I can improve FileBlob by storing the content in memory if it is under a max. limit like 64K. This way the factory method
FileManagerUtils.createSerializableBlob(UploadedFile)

This way we will have a generic SerializableBlob good for storing any kind of data (large contents or small ones)

Bogdan

Andréas Kalogéropoulos wrote:
You seem to omit the mime/type in your method.
UploadedFile has one, but in case it is "application/octet-stream", it
should try to sniff it using NXMimeTypes, no?

Plugins don't use an UploadFile, so do you think there need to be another
method, that will also uses FileBlob ?

In all cases, great job! :)
Andreas
  
Hi all,

Now the FileBlob is serializable so you can use it for large blobs
instead of using ByteArrayBlob
The recommended way to create blobs from an uploaded file is to use the
method

FileManagerUtils.createSerializableBlob(UploadedFile)

This method is creating a FileBlob (that stores data on a temp file on
hdd) if the uploaded  data is larger than 64K otherwise it creates a
ByteArrayBlob to store it in memory.

Bogdan
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm


    



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

  

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to