Monday, 15 June 2015

java - how to grant access of local file system to Wildfly server -


I am trying to write a file in java. I'm using simple "FileOutputStream" My app is positioned on " WildFly 8.0 runtime server "

My code is:

FileOutputStream fos = new FileOutputStream (new file ("c: /newfile.txt"));

I'm getting an exception:

19: 24: 36,235 error [stderr] (default task-8 ) Java.io.FileNotFoundException: c: \ newfile.txt (entry is denied)

19: 24: 36,237 error [stderr] (default Java.io.fileOutputStream.open (basic method)

1 9: 24: 36,239 error [stderr] (default task-8) at java.io.FileOutputStream. (FileOutputStream.java: 221)

19: 24: 36,240 error [Stderr] (default task-8) at java.io.FileOutputStream. (FileOutputStream.java:171)

19: 24: 36,240 error [stderr] (default task-8) com.ewals.ngalrspringapp At .controller.SelfieController.processImage (Selfiefe Runtister. Java.122)

19: 24: 36,241 error [stderr] (default task-8) SsorImpl.invoke0 (basic method) at Sun.reflect.NativeMethodAcce

1 9: 24: 36,241 error [stderr] (default task-8) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57)

19: 24: 36,242 error [stderr] (default task) -8) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)

This is my code working properly ApacheTMAC v7.0 Server .


1 comment: