wood burning stoves 2.0*
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
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "file permissions" Watch "file permissions" New topic
Author

file permissions

nabou diack
Greenhorn

Joined: Oct 17, 2001
Posts: 13
hi
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:
grant
{permission java.io.FilePermission "//Omni//bills//fac.html", "read,write,execute";
}
nabou diack
Greenhorn

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
xt.java:273)
at java.security.AccessController.checkPermission(AccessController.java:
404)
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.
java:42)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:28)
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
63)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:704)
at java.lang.Thread.run(Thread.java:539)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: file permissions