Package java.util

Examples of java.util.PropertyPermission


     */
    public static String setProperty(String key, String value) {
  checkKey(key);
  SecurityManager sm = getSecurityManager();
        if (sm != null) {
      sm.checkPermission(new PropertyPermission(key,
    SecurityConstants.PROPERTY_WRITE_ACTION));
  }

  return (String) props.setProperty(key, value);
    }
View Full Code Here


     */
    public static String clearProperty(String key) {
  checkKey(key);
  SecurityManager sm = getSecurityManager();
        if (sm != null) {
            sm.checkPermission(new PropertyPermission(key, "write"));
  }

        return (String) props.remove(key);
    }
View Full Code Here

     * @see        java.lang.System#getProperties()
     * @see        java.lang.System#setProperties(java.util.Properties)
     * @see        #checkPermission(java.security.Permission) checkPermission
     */
    public void checkPropertiesAccess() {
        checkPermission(new PropertyPermission("*",
      SecurityConstants.PROPERTY_RW_ACTION));
    }
View Full Code Here

     *
     * @see        java.lang.System#getProperty(java.lang.String)
     * @see        #checkPermission(java.security.Permission) checkPermission
     */
    public void checkPropertyAccess(String key) {
        checkPermission(new PropertyPermission(key,
      SecurityConstants.PROPERTY_READ_ACTION));
    }
View Full Code Here

    Permission rootReadPerm =
      new FilePermission(File.separator, "read");

    Permission tmpdirPropPerm =
      new PropertyPermission("java.io.tmpdir", "read");

    Permission modifyThreadGroup =
      new RuntimePermission("modifyThreadGroup");
    Permission shutdownHooks =
      new RuntimePermission("shutdownHooks");
View Full Code Here

        if (prop.length() == 0) {
            throw new IllegalArgumentException();
        }
        SecurityManager secMgr = System.getSecurityManager();
        if (secMgr != null) {
            secMgr.checkPermission(new PropertyPermission(prop, "write"));
        }
        return (String) systemProperties.setProperty(prop, value);
    }
View Full Code Here

            throw new IllegalArgumentException();
        }

        SecurityManager secMgr = System.getSecurityManager();
        if (secMgr != null) {
            secMgr.checkPermission(new PropertyPermission(key, "write"));
        }
        return (String) systemProperties.remove(key);
    }
View Full Code Here

      Permission[] createRobot = new Permission[] {
  new AWTPermission("createRobot")};

      Permission[] readProperty = new Permission[] {
  new PropertyPermission("*", "read")};

      TestSecurityManager sm = new TestSecurityManager(harness);
      try {
  sm.install();

View Full Code Here

  {
    if (new RuntimePermission("setSecurityManager").implies(p))
      return;
    if (new SecurityPermission("getProperty.networkaddress.*").implies(p))
      return;
    if (new PropertyPermission("sun.net.inetaddr.ttl", "read").implies(p))
      return;
    super.checkPermission(p);
  }
View Full Code Here

  new RuntimePermission("getenv." + a_variable)};
      Permission[] readNonVariable = new Permission[] {
  new RuntimePermission("getenv." + not_a_variable)};

      Permission[] readWriteAllProperties = new Permission[] {
  new PropertyPermission("*", "read,write")};

      Permission[] readProperty = new Permission[] {
  new PropertyPermission(a_property, "read")};
      Permission[] readNonProperty = new Permission[] {
  new PropertyPermission(not_a_property, "read")};

      Permission[] setIO = new Permission[] {
  new RuntimePermission("setIO")};
     
      Permission[] writeProperty = new Permission[] {
  new PropertyPermission(a_property, "write")};
      Permission[] writeNonProperty = new Permission[] {
  new PropertyPermission(not_a_property, "write")};

      Permission[] setSecurityManager = new Permission[] {
  new RuntimePermission("setSecurityManager")};
     
      TestSecurityManager sm = new TestSecurityManager(harness);
View Full Code Here

TOP

Related Classes of java.util.PropertyPermission

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.