Unable to extend file storage bean

Hi Everyone,

I am trying to encrypt the files before i store them in the file system.
For this i have extended filestorage bean and overrided loadfile/savefile methods. I have updated the spring.xml in core module with the latest extended class. When a file is uploaded i do not see the overrided savefile being called and i see the file in filesystem as unencrypted.

I have written a test application and attached to this thread.
Could someone please help me in understanding why the extended bean method was not called.testproject.zip (407.1 KB)

Thanks in advance for the support.

Hi,
You have overriden not all of required methods.
When fileUploadField uploads file, it uses the com.haulmont.cuba.core.app.FileStorageAPI#saveStream method to save file to disk.

You need to override all methods exposed by the com.haulmont.cuba.core.app.FileStorageAPI interface to be sure that standard implementation is not called bypassing your encryption / decryption logic.

Hi Padma,
Did you get this to work ?
If so, Care to share your example code ?
Thanks