Code example for Permissions

0
  private static PermissionCollection perms;
 
  public MinimalPolicy() { 
      super(); 
      if (perms == null) {
          perms = new Permissions();
          addPermissions(); 
      } 
  } 
 
  @Override 
  public PermissionCollection getPermissions(CodeSource codesource) {
      return perms;
  } 
 
  private void addPermissions() { 
      SocketPermission socketPermission = new SocketPermission("*:1199", "connect, resolve");
      PropertyPermission propertyPermission = new PropertyPermission("*", "read, write");
      FilePermission filePermission = new FilePermission("<<ALL FILES>>", "read");
 
      perms.add(socketPermission);