I'm not sure if the fact that I'm using a Ubuntu server matters. When I try to create a folder using the File.mkdirs () method, it does not throw an exception, it just never works.
A more detailed description of my problem with specific code links can be found here: Unable to create a directory on the server. Problem with resolution?
The reason I'm writing a new question is because I am wondering if I have problems creating directories on the server due to permissions.
String path = /home/username/foldertocreate; File file = new File(path); file.mkdirs();
So, I'm trying to create a folder in the / home / username directory. This works fine when I run in dev mode in my dev block and in the tomcat instance inside Eclipse, but does not work when the code runs on the server. Could this be due to the fact that the user is logged in in the dev block, and therefore it is allowed to open the / home / username folder? On the server, the user is not actually logged in while the program is running ...
Is there a specific folder that I can write to?
I checked permissions for the folder that is currently set to 700. Could this be a problem? Is it safe to set this folder to 666 or 777? Is this folder accessible even if the user is not registered?
Update: I tried changing the permissions of the folder to 755 without any luck.
source share