FileDocCategorySizeDatePackage
SecuritySupport12.javaAPI DocJava SE 6 API4801Tue Jun 10 00:22:58 BST 2008com.sun.org.apache.xml.internal.dtm.ref

SecuritySupport12

public class SecuritySupport12 extends SecuritySupport
This class is duplicated for each Xalan-Java subpackage so keep it in sync. It is package private and therefore is not exposed as part of the Xalan-Java API. Security related methods that only work on J2SE 1.2 and newer.

Fields Summary
Constructors Summary
Methods Summary
java.lang.ClassLoadergetContextClassLoader()

        return (ClassLoader)
                AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() {
                ClassLoader cl = null;
                try {
                    cl = Thread.currentThread().getContextClassLoader();
                } catch (SecurityException ex) { }
                return cl;
            }
        });
    
booleangetFileExists(java.io.File f)

    return ((Boolean)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    return new Boolean(f.exists());
                }
            })).booleanValue();
    
java.io.FileInputStreamgetFileInputStream(java.io.File file)

        try {
            return (FileInputStream)
                AccessController.doPrivileged(new PrivilegedExceptionAction() {
                    public Object run() throws FileNotFoundException {
                        return new FileInputStream(file);
                    }
                });
        } catch (PrivilegedActionException e) {
            throw (FileNotFoundException)e.getException();
        }
    
longgetLastModified(java.io.File f)

    return ((Long)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    return new Long(f.lastModified());
                }
            })).longValue();
    
java.lang.ClassLoadergetParentClassLoader(java.lang.ClassLoader cl)

        return (ClassLoader)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    ClassLoader parent = null;
                    try {
                        parent = cl.getParent();
                    } catch (SecurityException ex) {}

                    // eliminate loops in case of the boot
                    // ClassLoader returning itself as a parent
                    return (parent == cl) ? null : parent;
                }
            });
    
java.io.InputStreamgetResourceAsStream(java.lang.ClassLoader cl, java.lang.String name)

        return (InputStream)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    InputStream ris;
                    if (cl == null) {
                        ris = ClassLoader.getSystemResourceAsStream(name);
                    } else {
                        ris = cl.getResourceAsStream(name);
                    }
                    return ris;
                }
            });
    
java.lang.ClassLoadergetSystemClassLoader()

        return (ClassLoader)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    ClassLoader cl = null;
                    try {
                        cl = ClassLoader.getSystemClassLoader();
                    } catch (SecurityException ex) {}
                    return cl;
                }
            });
    
java.lang.StringgetSystemProperty(java.lang.String propName)

        return (String)
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    return System.getProperty(propName);
                }
            });