Java 8 AccessControlException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 AccessControlException class.

This code example shows how to use the following methods:
		} 
 
		IHostedThread robotProxy = threadManager.getLoadedOrLoadingRobotProxy(c);
 
		if (robotProxy == null) {
			throw new AccessControlException("Preventing " + c.getName() + " from access to " + g.getName());			
		} 
 
		if (cg.activeCount() > 5) {
			String message = "Robots are only allowed to create up to 5 threads!";
 
			robotProxy.punishSecurityViolation(message);
			throw new AccessControlException(message);
		} 
	} 
 
	private boolean isSafeThread(Thread c) {
		return threadManager.isSafeThread(c);
	} 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
        return; 
      } 
    } else if (dirPerms.getOtherAction().implies(action)) {
      return; 
    } 
    throw new AccessControlException("action " + action + " not permitted on path "
        + stat.getPath() + " for user " + user);
  } 
 
  private static String getSuperGroupName(Configuration configuration) {
    return configuration.get("dfs.permissions.supergroup", ""); 
  } 
 
  private static boolean userBelongsToSuperGroup(String superGroupName, List<String> groups) {
    return groups.contains(superGroupName);
  } 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
            if( !isSecure ) {
                System.err.println("Expected exception for insecure property <"+propKey+">");
                System.err.println("Message: "+se0.getMessage());
            } else { 
                System.err.println("Unexpected exception for secure property <"+propKey+">");
                se0.printStackTrace();
            } 
        } 
        if( isSecure ) {
            Assert.assertNull("AccessControlException thrown on secure property <"+propKey+">", se0);
        } else { 
            Assert.assertNotNull("AccessControlException not thrown on insecure property <"+propKey+">", se0);
        } 
    } 
 
    @Test
    public void testProp00_Temp() { 
        testPropImpl01(os_name_propkey, true);
    } 
 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
        } 
        if (packageNames == null || packageNames.length == 0) {
            throw new AccessControlException("package names must be specified");
        } 
        if (aid == null || aid.length == 0) {
            throw new AccessControlException("AID must be specified");
        } 
        if (aid.length < 5 || aid.length > 16) {
            throw new AccessControlException("AID has an invalid length");
        } 
         
        // create ara controller db if not available  
        // otherwise re-use access controller DB for caching 
        if( mAccessControlDB == null ) { 
        	mAccessControlDB = new AraControlDB();
        }  
        // set new applet handler since a new channel is used. 
    	mAccessControlDB.setApplet(new AccessRuleApplet(channel));
         
        if(checkForNfcAccess) // NFC Access Control
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
                // make sure they're not trying to 
                // update private information. 
                return; 
            } 
        } 
        throw new AccessControlException("You do not have the required permissions.");
    } 
 
    private void performClientChecks(OAuth2Authentication oAuth2Authentication, ScopePathType requiredScope, OrcidMessage orcidMessage, String orcid) {
        AuthorizationRequest authorizationRequest = oAuth2Authentication.getAuthorizationRequest();
        // If we have an ORCID in the request, we assume that this is intended 
        // as an update 
        if (orcidMessage != null && orcidMessage.getOrcidProfile() != null && StringUtils.isNotBlank(orcid)) {
 
            OrcidIdentifier orcidOb = orcidMessage.getOrcidProfile().getOrcidIdentifier();
            String messageOrcid = orcidOb != null ? orcidOb.getPath() : orcid;
            if (StringUtils.isNotBlank(messageOrcid) && !orcid.equals(messageOrcid)) {
                throw new IllegalArgumentException("The ORCID in the body and the URI do NOT match. Body ORCID: " + messageOrcid + " URI ORCID: " + orcid
                        + " do NOT match."); 
            } 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
				tempTlv = Response_DO_Factory.createDO(response.getData());
				if( tempTlv instanceof Response_RefreshTag_DO ) {
					refreshDo = (Response_RefreshTag_DO)tempTlv;
					return refreshDo.getRefreshTagArray();
				} else { 
					throw new AccessControlException("GET REFRESH TAG returned invalid Tlv.");
				} 
			} catch (ParserException e) {
				throw new AccessControlException("GET REFRESH TAG not successfull. Tlv encoding wrong.");
			} 
        }  
        throw new AccessControlException("GET REFRESH TAG not successfull.");			
    } 
 
    private ResponseApdu send(CommandApdu cmdApdu) throws org.simalliance.openmobileapi.service.CardException {
 
        byte[] response = mChannel.transmit(cmdApdu.toBytes());
 
        ResponseApdu resApdu = new ResponseApdu(response);
        return resApdu;
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
  public static Subject getSubject()
  { 
    AccessControlContext context = AccessController.getContext();
    Subject subject = Subject.getSubject(context);
    if (subject == null)
      throw new AccessControlException("Denied");
    return subject;
  } 
 
  public static Set<Principal> getPrincipals()
  { 
    return getSubject().getPrincipals();
  } 
 
  public static Set<Principal> getPrincipals(Class<Principal> c)
  { 
    Subject subject = getSubject();
    return subject.getPrincipals(c);
  } 
 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
        if (annotation != null) {
            String[] roles = annotation.value();
            String role = AccessControl.getCurrentRole();
            if (!Arrays.asList(roles).contains(role)) {
            	System.out.println("该角色木有权限哇~");
                throw new AccessControlException("The user is not allowed to invoke this method.");
            } 
        } 
        return method.invoke(accessObj, args);
         
//        java.util.Observable 
    }  
     
}  
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
        if (annotation != null) {
            String[] roles = annotation.value();
            //String role = AccessControl.getCurrentRole(); 
            String role = "admin";
            if (!Arrays.asList(roles).contains(role)) {
                throw new AccessControlException("该用户每权限访问该方法.");
            } 
        } 
        return method.invoke(accessObj, args);
    } 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    } 
 
    public void testAuthorisationFailure() 
    { 
        when(_broker.getSubjectCreator(any(SocketAddress.class), anyBoolean())).thenReturn(_usernamePasswordOkaySubjectCreator);
        doThrow(new AccessControlException(USER_NOT_AUTHORISED_FOR_MANAGEMENT)).when(_securityManager).accessManagement();
 
        try 
        { 
            _rmipa.authenticate(_credentials);
            fail("Exception not thrown");
        } 
        catch (SecurityException se)
        { 
            assertEquals("Unexpected exception message",
                    USER_NOT_AUTHORISED_FOR_MANAGEMENT, se.getMessage());
        } 
    } 
 
    public void testSubjectCreatorInternalFailure() 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Java 8 AccessControlException Methods: