Java Code Examples for java.security.PermissionCollection#setReadOnly()

The following examples show how to use java.security.PermissionCollection#setReadOnly() . 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 File: PermissionsWrapper.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 *
 */
private PermissionCollection getPerms0() {
  if (systemPermissions == null) {
    final PermissionCollection p = makePermissionCollection();
    if (readOnly && p != null) {
      p.setReadOnly();
    }
    systemPermissions = p;
  }
  return systemPermissions;
}
 
Example 2
Source File: PermissionsWrapper.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 *
 */
@Override
public void setReadOnly() {
  if (!readOnly) {
    readOnly = true;
    final PermissionCollection p = getPerms();
    if (p != null) {
      p.setReadOnly();
    } else {
      // TBD, Conditional permission already readonly?
    }
  }
}
 
Example 3
Source File: NbClassLoader.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Sets a PermissionsCollectio which will be used
 * for ProtectionDomain of newly created classes.
 *
 * @param defaultPerms
 */
public void setDefaultPermissions(PermissionCollection defaultPerms) {
    if (defaultPerms != null && !defaultPerms.isReadOnly()) {
        defaultPerms.setReadOnly();
    }
    this.defaultPermissions = defaultPerms;
}
 
Example 4
Source File: ObjectStreamClass.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a PermissionDomain that grants no permission.
 */
private ProtectionDomain noPermissionsDomain() {
    PermissionCollection perms = new Permissions();
    perms.setReadOnly();
    return new ProtectionDomain(null, perms);
}
 
Example 5
Source File: ObjectStreamClass.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a PermissionDomain that grants no permission.
 */
private ProtectionDomain noPermissionsDomain() {
    PermissionCollection perms = new Permissions();
    perms.setReadOnly();
    return new ProtectionDomain(null, perms);
}
 
Example 6
Source File: ObjectStreamClass.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
/**
 * Creates a PermissionDomain that grants no permission.
 */
private ProtectionDomain noPermissionsDomain() {
    PermissionCollection perms = new Permissions();
    perms.setReadOnly();
    return new ProtectionDomain(null, perms);
}
 
Example 7
Source File: ObjectStreamClass.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a PermissionDomain that grants no permission.
 */
private ProtectionDomain noPermissionsDomain() {
    PermissionCollection perms = new Permissions();
    perms.setReadOnly();
    return new ProtectionDomain(null, perms);
}
 
Example 8
Source File: ObjectStreamClass.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a PermissionDomain that grants no permission.
 */
private ProtectionDomain noPermissionsDomain() {
    PermissionCollection perms = new Permissions();
    perms.setReadOnly();
    return new ProtectionDomain(null, perms);
}
 
Example 9
Source File: ExecutionEngine.java    From netbeans with Apache License 2.0 4 votes vote down vote up
protected PermissionCollection createPermissions(CodeSource cs, InputOutput io) {
    PermissionCollection allPerms = new Permissions();
    allPerms.add(new AllPermission());
    allPerms.setReadOnly();
    return allPerms;
}
 
Example 10
Source File: ObjectStreamClass.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
/**
 * Creates a PermissionDomain that grants no permission.
 */
private ProtectionDomain noPermissionsDomain() {
    PermissionCollection perms = new Permissions();
    perms.setReadOnly();
    return new ProtectionDomain(null, perms);
}
 
Example 11
Source File: ObjectStreamClass.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a PermissionDomain that grants no permission.
 */
private ProtectionDomain noPermissionsDomain() {
    PermissionCollection perms = new Permissions();
    perms.setReadOnly();
    return new ProtectionDomain(null, perms);
}
 
Example 12
Source File: ObjectStreamClass.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
/**
 * Creates a PermissionDomain that grants no permission.
 */
private ProtectionDomain noPermissionsDomain() {
    PermissionCollection perms = new Permissions();
    perms.setReadOnly();
    return new ProtectionDomain(null, perms);
}
 
Example 13
Source File: ObjectStreamClass.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
/**
 * Creates a PermissionDomain that grants no permission.
 */
private ProtectionDomain noPermissionsDomain() {
    PermissionCollection perms = new Permissions();
    perms.setReadOnly();
    return new ProtectionDomain(null, perms);
}
 
Example 14
Source File: ObjectStreamClass.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a PermissionDomain that grants no permission.
 */
private ProtectionDomain noPermissionsDomain() {
    PermissionCollection perms = new Permissions();
    perms.setReadOnly();
    return new ProtectionDomain(null, perms);
}
 
Example 15
Source File: ObjectStreamClass.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a PermissionDomain that grants no permission.
 */
private ProtectionDomain noPermissionsDomain() {
    PermissionCollection perms = new Permissions();
    perms.setReadOnly();
    return new ProtectionDomain(null, perms);
}
 
Example 16
Source File: ObjectStreamClass.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a PermissionDomain that grants no permission.
 */
private ProtectionDomain noPermissionsDomain() {
    PermissionCollection perms = new Permissions();
    perms.setReadOnly();
    return new ProtectionDomain(null, perms);
}
 
Example 17
Source File: ObjectStreamClass.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
/**
 * Creates a PermissionDomain that grants no permission.
 */
private ProtectionDomain noPermissionsDomain() {
    PermissionCollection perms = new Permissions();
    perms.setReadOnly();
    return new ProtectionDomain(null, perms);
}