File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "Security on Runtime.getRuntime for File Watch "Security on Runtime.getRuntime for File New topic

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

gerson petry

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:
"" /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.


I agree. Here's the link:
subject: Security on Runtime.getRuntime for File's in desktop app.
It's not a secret anymore!