SecuritySupport.javaAPI DocJava SE 5 API5398Fri Aug 26 14:55:56 BST


public class SecuritySupport extends Object
This class is duplicated for each JAXP subpackage so keep it in sync. It is package private and therefore is not exposed as part of the JAXP API. Base class with security related methods that work on JDK 1.1.

Fields Summary
private static final Object
Constructors Summary
Methods Summary

	return null;
booleangetFileExists( f)

        return f.exists(); file)

        return new FileInputStream(file);
Return an appropriate instance of this class, depending on whether we're on a JDK 1.1 or J2SE 1.2 (or later) system.

	SecuritySupport ss = null;
	try {
	    Class c = Class.forName("");
	    // if that worked, we're on 1.2.
	    // don't reference the class explicitly so it doesn't
	    // get dragged in accidentally.
	    c = Class.forName("javax.mail.SecuritySupport12");
	    Constructor cons = c.getConstructor(new Class[] { });
	    ss = (SecuritySupport)cons.newInstance(new Object[] { });
	     * Unfortunately, we can't load the class using reflection
	     * because the class is package private.  And the class has
	     * to be package private so the APIs aren't exposed to other
	     * code that could use them to circumvent security.  Thus,
	     * we accept the risk that the direct reference might fail
	     * on some JDK 1.1 JVMs, even though we would never execute
	     * this code in such a case.  Sigh...
	    ss = new SecuritySupport12();
	} catch (Exception ex) {
	    // ignore it
	} finally {
	    if (ss == null)
		ss = new SecuritySupport();
	    securitySupport = ss;
	return (SecuritySupport)securitySupport;
longgetLastModified( f)

        return f.lastModified();
java.lang.ClassLoadergetParentClassLoader(java.lang.ClassLoader cl)

        return null; cl, java.lang.String name)

        InputStream ris;
        if (cl == null) {
            ris = ClassLoader.getSystemResourceAsStream(name);
        } else {
            ris = cl.getResourceAsStream(name);
        return ris;

        return null;
java.lang.StringgetSystemProperty(java.lang.String propName)

        return System.getProperty(propName);