wood burning stoves
The moose likes I/O and Streams and the fly likes file permissions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "file permissions" Watch "file permissions" New topic

file permissions

nabou diack

Joined: Oct 17, 2001
Posts: 13
I'm having troubles with file permissions in my java.policy
i'm trying to write in a a file named fac.html located in my server.
my server's name is omni and the file is in the directory bills . I tried the following but none of it works. can you help? thanks a lot
java .policy
i tried this
grant codeBase "file://omni:/bills/*" {
permission java.io.FilePermission "<<ALL FILES>>", "write";
i also tried this:
{permission java.io.FilePermission "//Omni//bills//fac.html", "read,write,execute";
nabou diack

Joined: Oct 17, 2001
Posts: 13
here is the error message i'm getting
java.security.AccessControlException: access denied (java.io.FilePermission Omni
net1\iManager\factures\facturefrancaise.html write)
at java.security.AccessControlContext.checkPermission(AccessControlConte
at java.security.AccessController.checkPermission(AccessController.java:
at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
at java.lang.SecurityManager.checkWrite(SecurityManager.java:978)
at java.io.File.createNewFile(File.java:827)
at accountServer.getFactureGeneree(accountserver.java:2232)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
at java.lang.reflect.Method.invoke(Method.java:327)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:264)
at sun.rmi.transport.Transport$1.run(Transport.java:151)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:147)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
at java.lang.Thread.run(Thread.java:539)
I agree. Here's the link: http://aspose.com/file-tools
subject: file permissions
It's not a secret anymore!