FileDocCategorySizeDatePackage
SecuritySupport.javaAPI DocApache Xerces 3.0.14883Fri Sep 14 20:33:52 BST 2007org.apache.xml.serialize

SecuritySupport

public final class SecuritySupport extends Object
This class is duplicated for each subpackage so keep it in sync. It is package private and therefore is not exposed as part of any API.
xerces.internal

Fields Summary
Constructors Summary
private SecuritySupport()

Methods Summary
static 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;
            }
        });
    
static booleangetFileExists(java.io.File f)

        return ((Boolean)
                AccessController.doPrivileged(new PrivilegedAction() {
                    public Object run() {
                        return f.exists() ? Boolean.TRUE : Boolean.FALSE;
                    }
                })).booleanValue();
    
static 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();
        }
    
static longgetLastModified(java.io.File f)

        return ((Long)
                AccessController.doPrivileged(new PrivilegedAction() {
                    public Object run() {
                        return new Long(f.lastModified());
                    }
                })).longValue();
    
static 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;
            }
        });
    
static 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;
            }
        });
    
static java.lang.ClassLoadergetSystemClassLoader()

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

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