Is there a way to check firewall setting in java code?

macrumors newbie

I have been googling for about 5 hours and I'm totally exhausted and knew serveral things below.

1. I have to know whether the firewall is monitoring networks or not in a java application. I mean, I have to detect the firewall setting in my application.

2. I've found the "ipfw" is related to mac OS's firewall. Is "ipfw" the only way to get the firewall setting?

3. I've found that I need the root permission to execute "ipfw list" on the terminal. Is it possible to get the root permission in java application to execute the script using Runtime.exec()? if it's impossible, after getting the root permission in a cocoa app, is it possible to run java app from cocoa?

MacRumors attracts a broad audience
of both consumers and professionals interested in
the latest technologies and products. We also boast an active community focused on
purchasing decisions and technical aspects of the iPhone, iPod, iPad, and Mac platforms.