377 if (p2 != null && policy.implies(this, p2)) {
378 return true;
379 }
380 }
381 }
382 if (permissions != null) {
383 if (permissions.implies(perm)) {
384 return true;
385 } else {
386 if (!p2Calculated) {
387 p2 = FilePermCompat.newPermUsingAltPath(perm);
388 }
389 if (p2 != null) {
390 return permissions.implies(p2);
391 }
392 }
393 }
394 return false;
395 }
396
397 // called by the VM -- do not remove
398 boolean impliesCreateAccessControlContext() {
399 return implies(SecurityConstants.CREATE_ACC_PERMISSION);
400 }
401
402 /**
403 * Convert a ProtectionDomain to a String.
404 */
405 @Override public String toString() {
406 String pals = "<no principals>";
407 if (principals != null && principals.length > 0) {
408 StringBuilder palBuf = new StringBuilder("(principals ");
409
410 for (int i = 0; i < principals.length; i++) {
411 palBuf.append(principals[i].getClass().getName() +
412 " \"" + principals[i].getName() +
413 "\"");
414 if (i < principals.length-1)
415 palBuf.append(",\n");
416 else
417 palBuf.append(")\n");
|
377 if (p2 != null && policy.implies(this, p2)) {
378 return true;
379 }
380 }
381 }
382 if (permissions != null) {
383 if (permissions.implies(perm)) {
384 return true;
385 } else {
386 if (!p2Calculated) {
387 p2 = FilePermCompat.newPermUsingAltPath(perm);
388 }
389 if (p2 != null) {
390 return permissions.implies(p2);
391 }
392 }
393 }
394 return false;
395 }
396
397 boolean impliesCreateAccessControlContext() {
398 return implies(SecurityConstants.CREATE_ACC_PERMISSION);
399 }
400
401 /**
402 * Convert a ProtectionDomain to a String.
403 */
404 @Override public String toString() {
405 String pals = "<no principals>";
406 if (principals != null && principals.length > 0) {
407 StringBuilder palBuf = new StringBuilder("(principals ");
408
409 for (int i = 0; i < principals.length; i++) {
410 palBuf.append(principals[i].getClass().getName() +
411 " \"" + principals[i].getName() +
412 "\"");
413 if (i < principals.length-1)
414 palBuf.append(",\n");
415 else
416 palBuf.append(")\n");
|