0

I'm creating an app using grails that generates multiple files as a process output, and put them on some folders that later will be access by ftp by other people.

Everything works great except that in production the new created files are created with access only for the user that runs tomcat, meaning that when somebody connects to the folder using ftp the files can't be open because they don't have permission.

is there any way to set permissions from grails or configure tomcat in a way that every output can be access by other users?.

2 Answers2

0

This might help. You can also look into executing shell commands but that may not be the best option.

Community
  • 1
  • 1
Todd Sharp
  • 2,927
  • 2
  • 17
  • 27
0

I found out that there is actually a method for the class File that changes the permissions for an instance of file, I was trying to use it but I notice only changed the permissions for the owner, but with a slight change on the parameters you can tell it to apply to other users too.

File.setReadable(boolean readable)

File.setReadable(boolean readable,boolean ownerOnly)

So in my case file.setReadable true,false made the trick.

Check out the class methods for more info java.io.File