I'm trying to write portlet, in which I want to create/edit some .properties file inside other portlet (I want to manipulate properties file responsible for translates from other portlet). I want to do this in the following way:
Properties prop = new Properties();
prop.setProperty("...", "...");
String pathToOhterPortletPropertiesFile = ...
prop.store(pathToOhterPortletPropertiesFile);
After run there are following errors:
SEVERE: Servlet.service() for servlet Seap Servlet threw exception
java.io.FileNotFoundException: (...my path...)\tomcat- 7.0.27\webapps (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at main.Translator.processAction(Translator.java:49)
Does anybody know solve for my problem?
Regards
I would suggest using portlet events to solve this instead. Have your first portlet send an event to the portlet that owns the properties file. On the event, pass along the information the other portlet will need to make the update. Then have the other portlet update its own properties.