List of usage examples for org.apache.commons.lang IncompleteArgumentException IncompleteArgumentException
public IncompleteArgumentException(String argName)
Instantiates with the specified description.
From source file:com.smartitengineering.util.simple.reflection.DefaultClassScannerImpl.java
public void scan(String[] packages, ClassVisitor classVisitor) throws IllegalArgumentException { if (packages == null || packages.length <= 0 || classVisitor == null) { throw new IncompleteArgumentException("packages and/or classVisitor"); }//from www . j a v a 2 s.co m for (String pckg : packages) { if (StringUtils.isBlank(pckg)) { continue; } try { String filePath = pckg.replace('.', '/'); Enumeration<URL> urls = classLoader.getResources(filePath); while (urls.hasMoreElements()) { URL url = urls.nextElement(); try { URI uri = getURI(url); scanForVisit(uri, filePath, classVisitor); } catch (URISyntaxException e) { } } } catch (IOException ex) { throw new RuntimeException(ex); } } }
From source file:com.smartitengineering.util.simple.reflection.DefaultClassScannerImpl.java
public void scan(File[] paths, ClassVisitor classVisitor) throws IllegalArgumentException { if (paths == null || paths.length <= 0 || classVisitor == null) { throw new IncompleteArgumentException("paths and/or classVisitor"); }//from ww w. j a v a 2 s . co m for (File file : paths) { scanForVisit(file, classVisitor); } }
From source file:com.aionemu.gameserver.services.item.HouseObjectFactory.java
/** * For transferring item from inventory to house registry *///from w w w . j av a 2 s . co m public static HouseObject<?> createNew(House house, ItemTemplate itemTemplate) { if (itemTemplate.getActions() == null) { throw new IncompleteArgumentException("template actions null"); } SummonHouseObjectAction action = itemTemplate.getActions().getHouseObjectAction(); if (action == null) { throw new IncompleteArgumentException("template actions miss SummonHouseObjectAction"); } int objectTemplateId = action.getTemplateId(); HouseObject<?> obj = createNew(house, IDFactory.getInstance().nextId(), objectTemplateId); if (obj.getObjectTemplate().getUseDays() > 0) { int expireEnd = (int) (DateTime.now().plusDays(obj.getObjectTemplate().getUseDays()).getMillis() / 1000); obj.setExpireTime(expireEnd); } return obj; }
From source file:kx.c.java
public static Object[] autoboxArray(Object data) { if (data.getClass().isArray()) { Object[] dstArray = new Object[Array.getLength(data)]; for (int row = 0; row < Array.getLength(data); row++) { Object o = Array.get(data, row); if (o == null) { o = "::"; }//from ww w. ja v a 2s .c o m if (o instanceof char[]) { // char arrays are strings... o = new String((char[]) o); } else if (o.getClass().isArray()) { o = autoboxArray(o); } Array.set(dstArray, row, o); } return dstArray; } throw new IncompleteArgumentException("data was not an array"); }
From source file:com.wso2telco.Endpoints.java
@POST @Path("/save/userChallenges") @Consumes("application/json") @Produces("application/json") public Response saveUserChallenges(String request) { log.info("Saving user challenges"); AuthenticationDetails authenticationDetails = new Gson().fromJson(request, AuthenticationDetails.class); String sessionId = authenticationDetails.getSessionId(); AuthenticationContext authenticationContext = getAuthenticationContext(sessionId); if (StringUtils.isEmpty(authenticationDetails.getChallengeQuestion1()) || StringUtils.isEmpty(authenticationDetails.getChallengeQuestion2()) || StringUtils.isEmpty(authenticationDetails.getChallengeAnswer1()) || StringUtils.isEmpty(authenticationDetails.getChallengeAnswer2())) { throw new IncompleteArgumentException("All inputs must be completed before saving user challenges"); }/*from w w w. j a v a2 s .c o m*/ authenticationContext.setProperty(Constants.CHALLENGE_QUESTION_1, authenticationDetails.getChallengeQuestion1()); authenticationContext.setProperty(Constants.CHALLENGE_QUESTION_2, authenticationDetails.getChallengeQuestion2()); authenticationContext.setProperty(Constants.CHALLENGE_ANSWER_1, authenticationDetails.getChallengeAnswer1()); authenticationContext.setProperty(Constants.CHALLENGE_ANSWER_2, authenticationDetails.getChallengeAnswer2()); SaveChallengesResponse saveChallengesResponse = new SaveChallengesResponse(sessionId, StatusCode.SUCCESS.getCode()); return Response.status(Response.Status.OK).entity(new Gson().toJson(saveChallengesResponse)).build(); }
From source file:org.gradle.cache.tasks.http.HttpTaskOutputCache.java
public HttpTaskOutputCache(URI root) { if (!root.getPath().endsWith("/")) { throw new IncompleteArgumentException("HTTP cache root URI must end with '/'"); }/*from w w w . j av a2 s.co m*/ this.root = root; }
From source file:org.gradle.caching.http.internal.HttpBuildCache.java
public HttpBuildCache(URI root) { if (!root.getPath().endsWith("/")) { throw new IncompleteArgumentException("HTTP cache root URI must end with '/'"); }/*from w w w.j a va2 s.c o m*/ this.root = root; this.safeUri = safeUri(root); this.httpClient = HttpClients.createDefault(); }
From source file:org.gradle.caching.http.internal.HttpBuildCacheService.java
public HttpBuildCacheService(HttpClientHelper httpClientHelper, URI url) { if (!url.getPath().endsWith("/")) { throw new IncompleteArgumentException("HTTP cache root URI must end with '/'"); }/* ww w. j a v a2s .com*/ this.root = url; this.httpClientHelper = httpClientHelper; }
From source file:org.openinfobutton.responder.service.impl.ResponderServiceImpl.java
/** * * @param requestParameters//from w ww. j av a 2 s . co m * @return */ @Override public Map<String, Map<String, String>> getIndexPropertyInterpretationMap( Collection<RequestParameter> requestParameters) { if (requestParameterCodeMap != null) { // if already built, don't need to rebuild; static return requestParameterCodeMap; } requestParameterCodeMap = new HashMap<>(); String lastParameterRoot = null; Map<String, String> parameterMap = new HashMap<>(); for (RequestParameter requestParameter : requestParameters) { if (isIncompleteRequestParameter(requestParameter)) { throw new IncompleteArgumentException( "Supported request parameters must have a parameterName, parameterRoot, and typeCode. " + "Invalid parameter id = " + requestParameter.getRequestParameterId()); } if (lastParameterRoot != null && !lastParameterRoot.equals(requestParameter.getParameterRoot())) { requestParameterCodeMap.put(lastParameterRoot, parameterMap); parameterMap = new HashMap<>(); } parameterMap.put(requestParameter.getTypeCode(), requestParameter.getParameterName()); lastParameterRoot = requestParameter.getParameterRoot(); } requestParameterCodeMap.put(lastParameterRoot, parameterMap); return requestParameterCodeMap; }