/* applet classPathParm reads and parses Java classpath */ /* M. Gallant 07/30/2000 */ import java.awt.*; import java.applet.*; import java.io.* ; import java.util.*; import netscape.security.PrivilegeManager; public class classPathParm extends Applet { TextArea ta = new TextArea (15, 75); private boolean grantedprivileges = false; public void init() { this.setBackground(new Color(192,192,192)) ; add(ta) ; try { PrivilegeManager.enablePrivilege("UniversalPropertyRead") ; grantedprivileges = true ; } catch (netscape.security.ForbiddenTargetException e) { System.out.println("Requested privileges were not granted by user."); return ; } catch(Exception cnfe) { System.out.println("netscape.security.PrivilegeManager class not found") ; } String clspth = System.getProperty("java.class.path") ; String platform = System.getProperty("os.name") ; StringTokenizer st = null; if(platform.indexOf("Win")>=0) st = new StringTokenizer(clspth,"\t\n\r;"); // Windows else st = new StringTokenizer(clspth,"\t\n\r:"); //UNIX or Mac ta.setText("------- Classpath Components: ---------------\n") ; while (st.hasMoreTokens()) { ta.append(st.nextToken()+"\n"); } } public boolean hasPrivileges() { return grantedprivileges ; } }