PrintWriter out = new PrintWriter(new BufferedWriter(policy));
Enumeration ee = grantElements();
out.println("/* Generated by asupgrade on "+
(new java.util.Date()) + " */");
out.println("/* Copyright 2004 Sun Microsystems, Inc. All rights reserved. */");
out.println("/* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */");
out.println();
// write the (unexpanded) keystore entry as the first entry of the
// policy file
if (getKeyStoreUrl() != null) {
writeKeyStoreEntry(out);
}
// write "grant" entries
while (ee.hasMoreElements()) {
GrantEntry ge = (GrantEntry) ee.nextElement();
ge.write(out);
out.println();
}
out.flush();
out.close();