This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Security and the fly likes Security on Runtime.getRuntime for File's in desktop app. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "Security on Runtime.getRuntime for File Watch "Security on Runtime.getRuntime for File New topic
Author

Security on Runtime.getRuntime for File's in desktop app.

gerson petry
Greenhorn

Joined: Jan 17, 2013
Posts: 1
Hi there. I'm pretty new in the forum, and in english language too.
There's my doubt: I'm wrote an app for me, and ran it without a security manager.
The code below works like a charm:


When i ran it under the secutiry manager, it gave me a exception:

Of course, if a give that permission, all works again.

I try give a permission only for one directory, ou more, and the exception remains. My question is:
The only way i could use the getRuntime command is give permission of <<ALL FILES>> ? Or could I intercept the security and check against a permission, let's say:
"java.io.FilePermission" /media/Wind/-" "execute");
I"m using the Dektop.ope(file) feature, and the exception are the same. I try several ways, and the exception don't change. Always the "<ALL FILES>>, execute" thing.
<ALL FILES>> it's a little scary to me.

I'm new in the security stuff in java, but i have a clue how it's work.

I hope i'm could explain myself in understandable way.

Regards.







 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Security on Runtime.getRuntime for File's in desktop app.