Java Reference
In-Depth Information
// Create a Properties object
Properties p
=
new
new
Properties
();
// Load the properties file into the Properties object
try
try
{
p
.
load
(
is
);
}
catch
catch
(
IOException ex
) {
System
.
err
.
println
(
"Load failed: "
+
ex
);
return
return
;
}
// List it to confirm that we loaded it.
p
.
list
(
System
.
out
);
Notice that
getResource()
returns a
java.net.URL
object here whereas
getRe-
sourceAsStream()
returns an
InputStream
.
If you want the application to have “nonsandbox” (i.e., full application) permissions, you
must sign the application's JAR files. The procedure to sign a JAR file digitally is described
in
Signing Your JAR File
.
If you request full permissions and don't sign all your application
JAR files, the sad note shown in
Figure 21-9
displays.
Figure 21-9. Unsigned application failure