java.io.SerializablePermission Java Examples

The following examples show how to use java.io.SerializablePermission. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: InputStream.java    License: Apache License 2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
 
Example #2
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: OutputStream.java    License: Apache License 2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
 
Example #3
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: StubFactoryDynamicBase.java    License: Apache License 2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission(
                "enableSubclassImplementation"));
    }
    return null;
}
 
Example #4
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: Util.java    License: Apache License 2.0 5 votes vote down vote up
private static void isCustomSerializationPermitted() {
    SecurityManager sm = System.getSecurityManager();
    if (!allowCustomValueHandler) {
        if ( sm != null) {
            // check that a serialization permission has been
            // set to allow the loading of the Util delegate
            // which provides access to custom ValueHandler
            sm.checkPermission(new SerializablePermission(
                    "enableCustomValueHandler"));
        }
    }
}
 
Example #5
Source Project: dragonwell8_jdk   Author: alibaba   File: ObjectInputFilter.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Set the process-wide filter if it has not already been configured or set.
 *
 * @param filter the serialization filter to set as the process-wide filter; not null
 * @throws SecurityException if there is security manager and the
 *       {@code SerializablePermission("serialFilter")} is not granted
 * @throws IllegalStateException if the filter has already been set {@code non-null}
 */
public static void setSerialFilter(ObjectInputFilter filter) {
    Objects.requireNonNull(filter, "filter");
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission("serialFilter"));
    }
    synchronized (serialFilterLock) {
        if (serialFilter != null) {
            throw new IllegalStateException("Serial filter can only be set once");
        }
        serialFilter = filter;
    }
}
 
Example #6
Source Project: TencentKona-8   Author: Tencent   File: InputStream.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
 
Example #7
Source Project: TencentKona-8   Author: Tencent   File: OutputStream.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
 
Example #8
Source Project: TencentKona-8   Author: Tencent   File: StubFactoryDynamicBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission(
                "enableSubclassImplementation"));
    }
    return null;
}
 
Example #9
Source Project: TencentKona-8   Author: Tencent   File: Util.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void isCustomSerializationPermitted() {
    SecurityManager sm = System.getSecurityManager();
    if (!allowCustomValueHandler) {
        if ( sm != null) {
            // check that a serialization permission has been
            // set to allow the loading of the Util delegate
            // which provides access to custom ValueHandler
            sm.checkPermission(new SerializablePermission(
                    "enableCustomValueHandler"));
        }
    }
}
 
Example #10
Source Project: TencentKona-8   Author: Tencent   File: ObjectInputFilter.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Set the process-wide filter if it has not already been configured or set.
 *
 * @param filter the serialization filter to set as the process-wide filter; not null
 * @throws SecurityException if there is security manager and the
 *       {@code SerializablePermission("serialFilter")} is not granted
 * @throws IllegalStateException if the filter has already been set {@code non-null}
 */
public static void setSerialFilter(ObjectInputFilter filter) {
    Objects.requireNonNull(filter, "filter");
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission("serialFilter"));
    }
    synchronized (serialFilterLock) {
        if (serialFilter != null) {
            throw new IllegalStateException("Serial filter can only be set once");
        }
        serialFilter = filter;
    }
}
 
Example #11
Source Project: jdk8u60   Author: chenghanpeng   File: InputStream.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
 
Example #12
Source Project: jdk8u60   Author: chenghanpeng   File: OutputStream.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
 
Example #13
Source Project: jdk8u60   Author: chenghanpeng   File: StubFactoryDynamicBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission(
                "enableSubclassImplementation"));
    }
    return null;
}
 
Example #14
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: InputStream.java    License: MIT License 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
 
Example #15
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: OutputStream.java    License: MIT License 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
 
Example #16
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: StubFactoryDynamicBase.java    License: MIT License 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission(
                "enableSubclassImplementation"));
    }
    return null;
}
 
Example #17
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: Util.java    License: MIT License 5 votes vote down vote up
private static void isCustomSerializationPermitted() {
    SecurityManager sm = System.getSecurityManager();
    if (!allowCustomValueHandler) {
        if ( sm != null) {
            // check that a serialization permission has been
            // set to allow the loading of the Util delegate
            // which provides access to custom ValueHandler
            sm.checkPermission(new SerializablePermission(
                    "enableCustomValueHandler"));
        }
    }
}
 
Example #18
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: InputStream.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
 
Example #19
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: OutputStream.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
 
Example #20
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: StubFactoryDynamicBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission(
                "enableSubclassImplementation"));
    }
    return null;
}
 
Example #21
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: Util.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void isCustomSerializationPermitted() {
    SecurityManager sm = System.getSecurityManager();
    if (!allowCustomValueHandler) {
        if ( sm != null) {
            // check that a serialization permission has been
            // set to allow the loading of the Util delegate
            // which provides access to custom ValueHandler
            sm.checkPermission(new SerializablePermission(
                    "enableCustomValueHandler"));
        }
    }
}
 
Example #22
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: ObjectInputFilter.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Set the process-wide filter if it has not already been configured or set.
 *
 * @param filter the serialization filter to set as the process-wide filter; not null
 * @throws SecurityException if there is security manager and the
 *       {@code SerializablePermission("serialFilter")} is not granted
 * @throws IllegalStateException if the filter has already been set {@code non-null}
 */
public static void setSerialFilter(ObjectInputFilter filter) {
    Objects.requireNonNull(filter, "filter");
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission("serialFilter"));
    }
    synchronized (serialFilterLock) {
        if (serialFilter != null) {
            throw new IllegalStateException("Serial filter can only be set once");
        }
        serialFilter = filter;
    }
}
 
Example #23
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: InputStream.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
 
Example #24
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: OutputStream.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
 
Example #25
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: StubFactoryDynamicBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission(
                "enableSubclassImplementation"));
    }
    return null;
}
 
Example #26
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: Util.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void isCustomSerializationPermitted() {
    SecurityManager sm = System.getSecurityManager();
    if (!allowCustomValueHandler) {
        if ( sm != null) {
            // check that a serialization permission has been
            // set to allow the loading of the Util delegate
            // which provides access to custom ValueHandler
            sm.checkPermission(new SerializablePermission(
                    "enableCustomValueHandler"));
        }
    }
}
 
Example #27
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: ObjectInputFilter.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Set the process-wide filter if it has not already been configured or set.
 *
 * @param filter the serialization filter to set as the process-wide filter; not null
 * @throws SecurityException if there is security manager and the
 *       {@code SerializablePermission("serialFilter")} is not granted
 * @throws IllegalStateException if the filter has already been set {@code non-null}
 */
public static void setSerialFilter(ObjectInputFilter filter) {
    Objects.requireNonNull(filter, "filter");
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission("serialFilter"));
    }
    synchronized (serialFilterLock) {
        if (serialFilter != null) {
            throw new IllegalStateException("Serial filter can only be set once");
        }
        serialFilter = filter;
    }
}
 
Example #28
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: InputStream.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
 
Example #29
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: OutputStream.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        if (!allowSubclass)
            sm.checkPermission(new
                SerializablePermission("enableSubclassImplementation"));
    }
    return null;
}
 
Example #30
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: StubFactoryDynamicBase.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static Void checkPermission() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SerializablePermission(
                "enableSubclassImplementation"));
    }
    return null;
}