There is now an issue with Ubuntu that uses Ubuntu user login SSH but creates folders and files as root owner.
The folder you are using is created as follows:
File File = new file (fileName);
File.getparentfile (). Mkdirs ();
So how does file determine the owner of the files in the process of creation? This is based on the permissions that are used when the Tomcat service is started.
If sudo is used at SH startup.sh, then the owner of the folders and files created in the service will be rooted.
So the processing method is:
1. Turn off Tomcat
2.sh startup.sh reboot Tomcat
3. Change the owner of all files back to the statement used by the CHOWN-R account name file or directory
Using chown-r ubuntu 06 here, you have modified the 06 folder and the owner of all the recursive file boxes folders under the folder. Note that r must be in uppercase.
Ubuntu Create file owner problem