0

I'm trying to use the sitemapgen4j library to build my sitemaps. I'm facing a permission problem while trying to write to my root directory

https://code.google.com/p/sitemapgen4j/

the root context folder (/src/main/webapp)

Exception

Problem writing sitemap file /sitemap.xml 
java.io.FileNotFoundException
/sitemap.xml (Permission denied)

Code

File directory = new File("/");
WebSitemapGenerator wsg = new WebSitemapGenerator("http://localhost:8080/app", directory);

Does anybody know how to go about doing this?

1 Answer 1

1

You are trying to write to root directory ('/') which is not writable for the user account you are using to run the sitemapgen4j (i.e. only root user can write to '/'). Change it to any directory where you have write access.

2
  • What's your thought on writing to a temp directory and then storing them on amazons s3 server where I could then just stream the files and avoid storing them on the app server all together?
    – George
    Jan 19, 2015 at 23:24
  • That would work or to your home directory. Jan 19, 2015 at 23:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .