I have the below method which is meant to append information to a file but I get the error below. In the method I use parts of robocode API which inherits from java.io.InputStream
All the permissions on the files and folders seem fine and the file does exist
static public void logInfo(String info)
{
RobocodeFileWriter in;
try {
in = new RobocodeFileWriter("log.txt");
in.append(info);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
SYSTEM: An error occurred during initialization of itc.solomon SYSTEM: java.security.AccessControlException: Preventing itc.solomon from access: (java.io.FilePermission log.txt read): You may only read files in your own root package directory. java.security.AccessControlException: Preventing itc.solomon from access: (java.io.FilePermission log.txt read): You may only read files in your own root package directory. at robocode.security.RobocodeSecurityManager.handleSecurityProblem(Unknown Source) at robocode.security.RobocodeSecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkRead(SecurityManager.java:888) at java.io.File.exists(File.java:748) at robocode.RobocodeFileOutputStream.(Unknown Source) at robocode.RobocodeFileOutputStream.(Unknown Source) at robocode.RobocodeFileWriter.(Unknown Source) at itc.CFile.logInfo(CFile.java:16) at itc.solomon.(solomon.java:43) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:532) at java.lang.Class.newInstance0(Class.java:372) at java.lang.Class.newInstance(Class.java:325) at robocode.peer.proxies.HostingRobotProxy.loadRobotRound(Unknown Source) at robocode.peer.proxies.HostingRobotProxy.run(Unknown Source) at java.lang.Thread.run(Thread.java:636)