File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Wrong file permission when creating a new folder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Wrong file permission when creating a new folder" Watch "Wrong file permission when creating a new folder" New topic

Wrong file permission when creating a new folder

Kristian Delin

Joined: Nov 29, 2011
Posts: 3

I'm trying to create folders and save files to these folders running my applications through tomcat. The problem is that when I'm creating a folder it gets the permission: rw-r--r-- when I then want to create a folder or file in that folder I don't have permission to do that. What do I have to do to be able to create folders with the permissions rwxr--r-- running from tomcat. I can do this when I'm not using tomcat. Can I make some configurations to make this work?
Ashwin Sridhar
Ranch Hand

Joined: Jul 09, 2011
Posts: 272

The problem may not be with Tomcat. You probably try and set read,write & execute booleans.

Ashwin Sridhar
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

Also, check to make sure that the userid that Tomcat is running under has those permissions (and in the case of Unix/Linux, umask settings).

Applications running inside of Tomcat should be operating under the same rules as they would if they were stand-alone java apps.

Also, PLEASE don't create files or directories inside WARs or the Tomcat directories (in case you're doing that). Even when it works, it's dangerous.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Wrong file permission when creating a new folder
It's not a secret anymore!