Add write access to particular directory for tomcat on Ubuntu

Setup: 

Ubuntu 20, Tomcat 9, upload dir: /myapp/upload (myapp & upload dir already owner by user tomcat and permission 775). 

Problem: 

application on tomcat still can't write into upload dir (this setup already works on Centos 7 & 8). 
 

Solution: 

 
edit file  /etc/systemd/system/multi-user.target.wants/tomcat9.service (don't forget to use sudo) and add the following lines under [Service] section:
ReadWritePaths=/path/to/the/directory/
save the file then reload service:
systemctl daemon-reload
systemctl restart tomcat9
Done, now the application on tomcat has write access into upload dir.