當前位置: 首頁>>代碼示例>>Java>>正文


Java Permission.getActions方法代碼示例

本文整理匯總了Java中java.security.Permission.getActions方法的典型用法代碼示例。如果您正苦於以下問題:Java Permission.getActions方法的具體用法?Java Permission.getActions怎麽用?Java Permission.getActions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.security.Permission的用法示例。


在下文中一共展示了Permission.getActions方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: formatPermission

import java.security.Permission; //導入方法依賴的package包/類
/** Format permission type, name, and actions into a string */
static String formatPermission(Permission permission) {
    StringBuilder sb = new StringBuilder();

    String clazz = null;
    if (permission instanceof UnresolvedPermission) {
        clazz = ((UnresolvedPermission) permission).getUnresolvedType();
    } else {
        clazz = permission.getClass().getName();
    }
    sb.append(clazz);

    String name = null;
    if (permission instanceof UnresolvedPermission) {
        name = ((UnresolvedPermission) permission).getUnresolvedName();
    } else {
        name = permission.getName();
    }
    if (name != null && name.length() > 0) {
        sb.append(' ');
        sb.append(name);
    }

    String actions = null;
    if (permission instanceof UnresolvedPermission) {
        actions = ((UnresolvedPermission) permission).getUnresolvedActions();
    } else {
        actions = permission.getActions();
    }
    if (actions != null && actions.length() > 0) {
        sb.append(' ');
        sb.append(actions);
    }
    return sb.toString();
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:36,代碼來源:PluginSecurity.java

示例2: getPIFromPermissions

import java.security.Permission; //導入方法依賴的package包/類
private PermissionInfo[] getPIFromPermissions(List perms) {
	PermissionInfo[] pi = new PermissionInfo[perms.size()];
	int index = 0;
	for (Iterator iterator = perms.iterator(); iterator.hasNext();) {
		Permission perm = (Permission) iterator.next();
		pi[index++] = new PermissionInfo(perm.getClass().getName(), perm.getName(), perm.getActions());
	}
	return pi;
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:10,代碼來源:BaseIntegrationTest.java

示例3: formatPermission

import java.security.Permission; //導入方法依賴的package包/類
/** Format permission type, name, and actions into a string */
static String formatPermission(Permission permission) {
    StringBuilder sb = new StringBuilder();
    
    String clazz = null;
    if (permission instanceof UnresolvedPermission) {
        clazz = ((UnresolvedPermission) permission).getUnresolvedType();
    } else {
        clazz = permission.getClass().getName();
    }
    sb.append(clazz);
    
    String name = null;
    if (permission instanceof UnresolvedPermission) {
        name = ((UnresolvedPermission) permission).getUnresolvedName();
    } else {
        name = permission.getName();
    }
    if (name != null && name.length() > 0) {
        sb.append(' ');
        sb.append(name);
    }
    
    String actions = null;
    if (permission instanceof UnresolvedPermission) {
        actions = ((UnresolvedPermission) permission).getUnresolvedActions();
    } else {
        actions = permission.getActions();
    }
    if (actions != null && actions.length() > 0) {
        sb.append(' ');
        sb.append(actions);
    }
    return sb.toString();
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:36,代碼來源:PluginSecurity.java

示例4: getOnosPermission

import java.security.Permission; //導入方法依賴的package包/類
public static org.onosproject.security.Permission getOnosPermission(Permission permission) {
    if (permission instanceof AppPermission) {
        return new org.onosproject.security.Permission(AppPermission.class.getName(), permission.getName(), "");
    } else if (permission instanceof FilePermission) {
        return new org.onosproject.security.Permission(
                FilePermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof SerializablePermission) {
        return new org.onosproject.security.Permission(
                SerializablePermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof NetPermission) {
        return new org.onosproject.security.Permission(
                NetPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof RuntimePermission) {
        return new org.onosproject.security.Permission(
                RuntimePermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof SocketPermission) {
        return new org.onosproject.security.Permission(
                SocketPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof SQLPermission) {
        return new org.onosproject.security.Permission(
                SQLPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof PropertyPermission) {
        return new org.onosproject.security.Permission(
                PropertyPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof LoggingPermission) {
        return new org.onosproject.security.Permission(
                LoggingPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof SSLPermission) {
        return new org.onosproject.security.Permission(
                SSLPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof AuthPermission) {
        return new org.onosproject.security.Permission(
                AuthPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof PrivateCredentialPermission) {
        return new org.onosproject.security.Permission(
                PrivateCredentialPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof DelegationPermission) {
        return new org.onosproject.security.Permission(
                DelegationPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof javax.security.auth.kerberos.ServicePermission) {
        return new org.onosproject.security.Permission(
                javax.security.auth.kerberos.ServicePermission.class.getName(), permission.getName(),
                permission.getActions());
    } else if (permission instanceof AudioPermission) {
        return new org.onosproject.security.Permission(
                AudioPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof AdaptPermission) {
        return new org.onosproject.security.Permission(
                AdaptPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof BundlePermission) {
        return new org.onosproject.security.Permission(
                BundlePermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof CapabilityPermission) {
        return new org.onosproject.security.Permission(
                CapabilityPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof PackagePermission) {
        return new org.onosproject.security.Permission(
                PackagePermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof ServicePermission) {
        return new org.onosproject.security.Permission(
                ServicePermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof AdminPermission) {
        return new org.onosproject.security.Permission(
                AdminPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof ConfigurationPermission) {
        return new org.onosproject.security.Permission(
                ConfigurationPermission.class.getName(), permission.getName(), permission.getActions());
    }
    return null;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:71,代碼來源:DefaultPolicyBuilder.java


注:本文中的java.security.Permission.getActions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。