org.apache.commons.lang.StringUtils源码实例Demo

javax.servlet.http.HttpServletRequestWrapper#org.apache.commons.lang.StringUtils源码实例Demo

下面列出了javax.servlet.http.HttpServletRequestWrapper#org.apache.commons.lang.StringUtils 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

@Override
public boolean validate() {
    if (StringUtils.isEmpty(bizContent.outTradeNo)) {
        throw new NullPointerException("out_trade_no should not be NULL!");
    }
    if (StringUtils.isEmpty(bizContent.totalAmount)) {
        throw new NullPointerException("total_amount should not be NULL!");
    }
    if (StringUtils.isEmpty(bizContent.subject)) {
        throw new NullPointerException("subject should not be NULL!");
    }
    if (StringUtils.isEmpty(bizContent.storeId)) {
        throw new NullPointerException("store_id should not be NULL!");
    }
    return true;
}
 
@Override
public Collection<? extends GrantedAuthority> mapAuthorities(Collection<? extends GrantedAuthority> authorities) {
  if (!groupRoleMap.isEmpty() && !authorities.isEmpty()) {
    List<SimpleGrantedAuthority> newAuthorities = new ArrayList<>();
    for (GrantedAuthority authority : authorities) {
      String withoutRoleStringLowercase = StringUtils.removeStart(authority.toString(), ROLE_PREFIX).toLowerCase();
      String withoutRoleStringUppercase = StringUtils.removeStart(authority.toString(), ROLE_PREFIX).toUpperCase();
      String simpleRoleLowercaseString = authority.toString().toLowerCase();
      String simpleRoleUppercaseString = authority.toString().toUpperCase();
      if (addAuthoritiy(newAuthorities, withoutRoleStringLowercase))
        continue;
      if (addAuthoritiy(newAuthorities, withoutRoleStringUppercase))
        continue;
      if (addAuthoritiy(newAuthorities, simpleRoleLowercaseString))
        continue;
      addAuthoritiy(newAuthorities, simpleRoleUppercaseString);
    }
    return newAuthorities;
  }
  return authorities;
}
 
源代码3 项目: idea-php-symfony2-plugin   文件: YamlHelper.java
/**
 * [ROLE_USER, FEATURE_ALPHA, ROLE_ALLOWED_TO_SWITCH]
 */
@NotNull
static public Collection<String> getYamlArrayValuesAsList(@NotNull YAMLSequence yamlArray) {
    Collection<String> keys = new ArrayList<>();

    for (YAMLSequenceItem yamlSequenceItem : yamlArray.getItems()) {
        YAMLValue value = yamlSequenceItem.getValue();
        if(!(value instanceof YAMLScalar)) {
            continue;
        }

        String textValue = ((YAMLScalar) value).getTextValue();
        if(StringUtils.isNotBlank(textValue)) {
            keys.add(textValue);
        }
    }

    return keys;
}
 
@Nullable
private Pair<String, Method> getParamater(@NotNull Project project, @NotNull String aClass, @NotNull java.util.function.Function<Void, Integer> function) {
    if(StringUtils.isNotBlank(aClass)) {
        PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(project, aClass);
        if(phpClass != null) {
            Method constructor = phpClass.getConstructor();
            if(constructor != null) {
                Integer argumentIndex = function.apply(null);
                if(argumentIndex >= 0) {
                    String s = attachMethodInstances(constructor, argumentIndex);
                    if(s == null) {
                        return null;
                    }

                    return Pair.create(s, constructor);
                }
            }
        }
    }

    return null;
}
 
private void attachXmlRelationMarker(@NotNull PsiElement target, @NotNull XmlAttributeValue psiElement, @NotNull Collection<LineMarkerInfo> results) {
    String value = psiElement.getValue();
    if(StringUtils.isBlank(value)) {
        return;
    }

    Collection<PhpClass> classesInterface = DoctrineMetadataUtil.getClassInsideScope(psiElement, value);
    if(classesInterface.size() == 0) {
        return;
    }

    NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(Symfony2Icons.DOCTRINE_LINE_MARKER).
        setTargets(classesInterface).
        setTooltipText("Navigate to class");

    results.add(builder.createLineMarkerInfo(target));
}
 
源代码6 项目: kfs   文件: PriorYearOrganization.java
/**
 * Gets the organizationCountry attribute.
 *
 * @return Returns the organizationCountry.
 */
public CountryEbo getOrganizationCountry() {
    if ( StringUtils.isBlank(organizationCountryCode) ) {
        organizationCountry = null;
    } else {
        if ( organizationCountry == null || !StringUtils.equals( organizationCountry.getCode(),organizationCountryCode) ) {
            ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(CountryEbo.class);
            if ( moduleService != null ) {
                Map<String,Object> keys = new HashMap<String, Object>(1);
                keys.put(LocationConstants.PrimaryKeyConstants.CODE, organizationCountryCode);
                organizationCountry = moduleService.getExternalizableBusinessObject(CountryEbo.class, keys);
            } else {
                throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class.  Unable to proceed." );
            }
        }
    }
    return organizationCountry;
}
 
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form,
		HttpServletRequest request, HttpServletResponse response) throws Exception {
       IdentityManagementGroupDocumentForm groupDocumentForm = (IdentityManagementGroupDocumentForm) form;
       if ( StringUtils.isBlank( groupDocumentForm.getGroupId() ) ) {
           String groupId = request.getParameter(KimConstants.PrimaryKeyConstants.GROUP_ID);
       	groupDocumentForm.setGroupId(groupId);
       }
	String kimTypeId = request.getParameter(KimConstants.PrimaryKeyConstants.KIM_TYPE_ID);
       setKimType(kimTypeId, groupDocumentForm);

       
	KualiTableRenderFormMetadata memberTableMetadata = groupDocumentForm.getMemberTableMetadata();
	if (groupDocumentForm.getMemberRows() != null) {
		memberTableMetadata.jumpToPage(memberTableMetadata.getViewedPageNumber(), groupDocumentForm.getMemberRows().size(), groupDocumentForm.getRecordsPerPage());
		// KULRICE-3972: need to be able to sort by column header like on lookups when editing large roles and groups
		memberTableMetadata.sort(groupDocumentForm.getMemberRows(), groupDocumentForm.getRecordsPerPage());
	}
	
	ActionForward forward = super.execute(mapping, groupDocumentForm, request, response);
	
	groupDocumentForm.setCanAssignGroup(validAssignGroup(groupDocumentForm.getGroupDocument()));
	return forward;
   }
 
源代码8 项目: website   文件: PrincePdfExecutor.java
@Override
public File execute(String htmlLocation, List<String> cssFiles) throws IOException, InterruptedException {
	Prince prince = new Prince(princePdfExecutableLocation);
	
	String newPdfFilename = getNewPdfFilename(htmlLocation);
	if (!StringUtils.startsWith(htmlLocation, "http")) {
		htmlLocation = FilenameUtils.concat(htmlFolder, htmlLocation);
		File f = new File(htmlLocation);
		if(!f.exists()) { 
			throw new IOException("File '" + htmlLocation + "' not found");
		}
		htmlLocation = "file://" + htmlLocation;
	}
	for (String cssFile : cssFiles) {
		prince.addStyleSheet(FilenameUtils.concat(htmlToPdfCssFolder, cssFile));
	}		
	prince.convert(htmlLocation, newPdfFilename);
	
       return new File(newPdfFilename);
}
 
@Override
public List<T> findByWhere(String where, Object[] values, String order, Integer max) throws PersistenceException {
	List<T> coll = new ArrayList<T>();
	try {
		String sorting = StringUtils.isNotEmpty(order) && !order.toLowerCase().contains("order by")
				? "order by " + order
				: order;
		String query = "from " + entityClass.getCanonicalName() + " _entity where _entity.deleted=0 "
				+ (StringUtils.isNotEmpty(where) ? " and (" + where + ") " : " ")
				+ (StringUtils.isNotEmpty(sorting) ? sorting : " ");
		coll = findByObjectQuery(query, values, max);
		return coll;
	} catch (Throwable e) {
		throw new PersistenceException(e);
	}
}
 
源代码10 项目: spork   文件: TestCSVExcelStorage.java
@Test
public void load() throws IOException, ParseException {
    String schema = "i: int, l: long, f: float, d: double, c: chararray, b: bytearray";

    pig.registerQuery(
        "data = load '" + dataDir + testFile + "' " +
        "using org.apache.pig.piggybank.storage.CSVExcelStorage(',', 'YES_MULTILINE', 'UNIX', 'SKIP_INPUT_HEADER') " + 
        "AS (" + schema + ");"
    );

    Iterator<Tuple> data = pig.openIterator("data");
    String[] expected = {
        // a header in csv_excel_data.csv should be skipped due to 'SKIP_INPUT_HEADER' being set in test_csv_storage_load.pig
        "(1,10,2.718,3.14159,qwerty,uiop)",  // basic data types
        "(1,10,2.718,3.14159,,)",            // missing fields at end
        "(1,10,,3.15159,,uiop)",             // missing field in the middle
        "(1,10,,3.15159,,uiop)",             // extra field (input data has "moose" after "uiop")
        "(1,,2.718,,qwerty,uiop)",           // quoted regular fields (2.718, qwerty, and uiop in quotes)
        "(1,,,,\nqwe\nrty, uiop)",           // newlines in quotes
        "(1,,,,qwe,rty,uiop)",               // commas in quotes
        "(1,,,,q\"wert\"y, uiop)",           // quotes in quotes
        "(1,,,,qwerty,u\"io\"p)"             // quotes in quotes at the end of a line
    };

    Assert.assertEquals(StringUtils.join(expected, "\n"), StringUtils.join(data, "\n"));
}
 
源代码11 项目: rice   文件: MaintenanceUtils.java
/**
 * Returns the field templates defined in the maint dictionary xml files. Field templates are used in multiple value lookups.
 * When doing a MV lookup on a collection, the returned BOs are not necessarily of the same type as the elements of the
 * collection. Therefore, a means of mapping between the fields for the 2 BOs are necessary. The template attribute of
 * &lt;maintainableField&gt;s contained within &lt;maintainableCollection&gt;s tells us this mapping. Example: a
 * &lt;maintainableField name="collectionAttrib" template="lookupBOAttrib"&gt; definition means that when a list of BOs are
 * returned, the lookupBOAttrib value of the looked up BO will be placed into the collectionAttrib value of the BO added to the
 * collection
 *
 * @param sections       the sections of a document
 * @param collectionName the name of a collection. May be a nested collection with indices (e.g. collA[1].collB)
 * @return
 */
public static Map<String, String> generateMultipleValueLookupBOTemplate(List<MaintainableSectionDefinition> sections, String collectionName) {
    MaintainableCollectionDefinition definition = findMaintainableCollectionDefinition(sections, collectionName);
    if (definition == null) {
        return null;
    }
    Map<String, String> template = null;

    for (MaintainableFieldDefinition maintainableField : definition.getMaintainableFields()) {
        String templateString = maintainableField.getTemplate();
        if (StringUtils.isNotBlank(templateString)) {
            if (template == null) {
                template = new HashMap<String, String>();
            }
            template.put(maintainableField.getName(), templateString);
        }
    }
    return template;
}
 
源代码12 项目: HtmlExtractor   文件: ExtractFunctionExecutor.java
/**
 * 删除子CSS路径的内容 使用方法:deleteChild(div.ep-source)
 * 括号内的参数为相对CSS路径的子路径,从CSS路径匹配的文本中删除子路径匹配的文本
 *
 * @param text CSS路径抽取出来的文本
 * @param doc 根文档
 * @param cssPath CSS路径对象
 * @param parseExpression 抽取函数
 * @return 抽取函数处理之后的文本
 */
public static String executeDeleteChild(String text, Document doc, CssPath cssPath, String parseExpression) {
    LOGGER.debug("deleteChild抽取函数之前:" + text);
    String parameter = parseExpression.replace("deleteChild(", "");
    parameter = parameter.substring(0, parameter.length() - 1);
    Elements elements = doc.select(cssPath.getCssPath() + " " + parameter);
    for (Element element : elements) {
        String t = element.text();
        if (StringUtils.isNotBlank(t)) {
            LOGGER.debug("deleteChild抽取函数删除:" + t);
            text = text.replace(t, "");
        }
    }
    LOGGER.debug("deleteChild抽取函数之后:" + text);
    return text;
}
 
@NotNull
@Override
public Collection<LookupElement> getLookupElements() {

    DoctrineMetadataModel model = DoctrineMetadataUtil.getMetadataByTable(getProject(), this.stringValue);
    if(model == null) {
        return Collections.emptyList();
    }

    Collection<LookupElement> elements = new ArrayList<>();
    for (DoctrineModelField field : model.getFields()) {
        String column = field.getColumn();

        // use "column" else fallback to field name
        if(column != null && StringUtils.isNotBlank(column)) {
            elements.add(LookupElementBuilder.create(column).withIcon(Symfony2Icons.DOCTRINE));
        } else {
            String name = field.getName();
            if(StringUtils.isNotBlank(name)) {
                elements.add(LookupElementBuilder.create(name).withIcon(Symfony2Icons.DOCTRINE));
            }
        }
    }

    return elements;
}
 
源代码14 项目: incubator-tajo   文件: RCFileScanner.java
public RCFileScanner(final Configuration conf, final Schema schema, final TableMeta meta, final FileFragment fragment)
     throws IOException {
   super(conf, meta, schema, fragment);

   this.start = fragment.getStartKey();
   this.end = start + fragment.getEndKey();
   key = new LongWritable();
   column = new BytesRefArrayWritable();

   String nullCharacters = StringEscapeUtils.unescapeJava(this.meta.getOption(NULL));
   if (StringUtils.isEmpty(nullCharacters)) {
     nullChars = NullDatum.get().asTextBytes();
   } else {
     nullChars = nullCharacters.getBytes();
   }
}
 
源代码15 项目: nosql4idea   文件: MongoResultPanel.java
private DBObject getSelectedMongoDocument() {
    TreeTableTree tree = resultTableView.getTree();
    NoSqlTreeNode treeNode = (NoSqlTreeNode) tree.getLastSelectedPathComponent();
    if (treeNode == null) {
        return null;
    }

    NodeDescriptor descriptor = treeNode.getDescriptor();
    if (descriptor instanceof MongoKeyValueDescriptor) {
        MongoKeyValueDescriptor keyValueDescriptor = (MongoKeyValueDescriptor) descriptor;
        if (StringUtils.equals(keyValueDescriptor.getKey(), "_id")) {
            return mongoDocumentOperations.getMongoDocument(keyValueDescriptor.getValue());
        }
    }

    return null;
}
 
源代码16 项目: openhab1-addons   文件: ISYBindingConfig.java
/**
 * Constructor
 * 
 * @param item
 *            full item from openhab
 * @param type
 *            the node type in ISY, rough translation.
 * @param controller
 *            the address of the controller.
 * @param address
 *            the address of the item to monitor for changes. same as
 *            controller if not specified.
 * @param command
 *            the command the system is sending for this controller.
 */
public ISYBindingConfig(Item item, ISYNodeType type, String controller, String address, ISYControl command) {
    this.item = item;
    this.type = type;
    this.controller = controller;
    if (StringUtils.isNotBlank(address)) {
        this.address = address;
    } else {
        this.address = controller;
    }
    if (command != null) {
        this.controlCommand = command;
    } else {
        this.controlCommand = ISYControl.ST;
    }
}
 
源代码17 项目: youkefu   文件: Base62.java
public static String encode(String str){ 
	    String md5Hex = DigestUtils.md5Hex(str);
	    // 6 digit binary can indicate 62 letter & number from 0-9a-zA-Z
	    int binaryLength = 6 * 6;
	    long binaryLengthFixer = Long.valueOf(StringUtils.repeat("1", binaryLength), BINARY);
	    for (int i = 0; i < 4;) {
	      String subString = StringUtils.substring(md5Hex, i * 8, (i + 1) * 8);
	      subString = Long.toBinaryString(Long.valueOf(subString, 16) & binaryLengthFixer);
	      subString = StringUtils.leftPad(subString, binaryLength, "0");
	      StringBuilder sbBuilder = new StringBuilder();
	      for (int j = 0; j < 6; j++) {
	        String subString2 = StringUtils.substring(subString, j * 6, (j + 1) * 6);
	        int charIndex = Integer.valueOf(subString2, BINARY) & NUMBER_61;
	        sbBuilder.append(DIGITS[charIndex]);
	      }
	      String shortUrl = sbBuilder.toString();
	      if(shortUrl!=null){
	    	  return shortUrl;
	      }
	    }
	    // if all 4 possibilities are already exists
	    return null;
}
 
源代码18 项目: rice   文件: ReviewResponsibilityTypeServiceImpl.java
@Override
protected List<Responsibility> performResponsibilityMatches(
		Map<String, String> requestedDetails,
		List<Responsibility> responsibilitiesList) {
	// get the base responsibility matches based on the route level and document type
	List<Responsibility> baseMatches = super.performResponsibilityMatches(requestedDetails,
			responsibilitiesList);
	// now, if any of the responsibilities have the "qualifierResolverProvidedIdentifier" detail property
	// perform an exact match on the property with the requested details
	// if the property does not match or does not exist in the requestedDetails, remove
	// the responsibility from the list
	Iterator<Responsibility> respIter = baseMatches.iterator();
	while ( respIter.hasNext() ) {
		Map<String, String> respDetails = respIter.next().getAttributes();
		if ( respDetails.containsKey( KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER ) && StringUtils.isNotBlank( respDetails.get(KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER) ) ) {
			if ( !requestedDetails.containsKey( KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER )
					|| !StringUtils.equals( respDetails.get(KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER)
							, requestedDetails.get(KimConstants.AttributeConstants.QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER))) {
				respIter.remove();
			}
		}
	}		
	return baseMatches;
}
 
/**
 * Delete a challenge set
 *
 * @param challengeSetId challenge question set id to delete
 * @param locale
 * @return
 */
public boolean deleteQuestionSet(String challengeSetId, String locale) {

    if (StringUtils.isEmpty(locale)) {
        locale = StringUtils.EMPTY;
    }
    try {
        if (isChallengeSetExists(challengeSetId, ContextLoader.getTenantDomainFromContext())) {
            getChallengeQuestionManager()
                    .deleteChallengeQuestionSet(challengeSetId, locale, ContextLoader.getTenantDomainFromContext());
        }
    } catch (IdentityRecoveryException e) {
        throw handleIdentityRecoveryException(e,
                ChallengeConstant.ErrorMessage.ERROR_CODE_ERROR_DELETING_CHALLENGES);
    }
    return true;
}
 
源代码20 项目: atlas   文件: AtlasBuiltInTypes.java
private boolean isValidMap(Map map) {
    Object guid = map.get(AtlasObjectId.KEY_GUID);

    if (guid != null && StringUtils.isNotEmpty(guid.toString())) {
        return true;
    } else {
        Object typeName = map.get(AtlasObjectId.KEY_TYPENAME);
        if (typeName != null && StringUtils.isNotEmpty(typeName.toString())) {
            Object uniqueAttributes = map.get(AtlasObjectId.KEY_UNIQUE_ATTRIBUTES);

            if (uniqueAttributes instanceof Map && MapUtils.isNotEmpty((Map) uniqueAttributes)) {
                return true;
            }
        }
    }

    return false;
}
 
源代码21 项目: kfs   文件: VendorServiceImpl.java
/**
 * @see org.kuali.kfs.vnd.document.service.VendorService#getVendorDetail(String)
 */
@Override
public VendorDetail getVendorDetail(String vendorNumber) {
    if (LOG.isDebugEnabled()) {
        LOG.debug("Entering getVendorDetail for vendorNumber: " + vendorNumber);
    }
    if (StringUtils.isBlank(vendorNumber)) {
        return null;
    }

    int dashInd = vendorNumber.indexOf('-');
    // make sure there's at least one char before and after '-'
    if (dashInd > 0 && dashInd < vendorNumber.length() - 1) {
        try {
            Integer headerId = new Integer(vendorNumber.substring(0, dashInd));
            Integer detailId = new Integer(vendorNumber.substring(dashInd + 1));
            return getVendorDetail(headerId, detailId);
        }
        catch (NumberFormatException e) {
            // in case of invalid number format
            return null;
        }
    }

    return null;
}
 
源代码22 项目: pentaho-kettle   文件: BaseJobServlet.java
private void copyJobParameters( Job job, Map<String, String> params ) throws UnknownParamException {
  JobMeta jobMeta = job.getJobMeta();
  // Also copy the parameters over...
  job.copyParametersFrom( jobMeta );
  job.clearParameters();
  String[] parameterNames = job.listParameters();
  for ( String parameterName : parameterNames ) {
    // Grab the parameter value set in the job entry
    String thisValue = params.get( parameterName );
    if ( !StringUtils.isBlank( thisValue ) ) {
      // Set the value as specified by the user in the job entry
      jobMeta.setParameterValue( parameterName, thisValue );
    }
  }
  jobMeta.activateParameters();
}
 
源代码23 项目: zheng   文件: UpmsUserRoleServiceImpl.java
@Override
public int role(String[] roleIds, int id) {
    int result = 0;
    // 删除旧记录
    UpmsUserRoleExample upmsUserRoleExample = new UpmsUserRoleExample();
    upmsUserRoleExample.createCriteria()
            .andUserIdEqualTo(id);
    upmsUserRoleMapper.deleteByExample(upmsUserRoleExample);
    // 增加新记录
    if (null != roleIds) {
        for (String roleId : roleIds) {
            if (StringUtils.isBlank(roleId)) {
                continue;
            }
            UpmsUserRole upmsUserRole = new UpmsUserRole();
            upmsUserRole.setUserId(id);
            upmsUserRole.setRoleId(NumberUtils.toInt(roleId));
            result = upmsUserRoleMapper.insertSelective(upmsUserRole);
        }
    }
    return result;
}
 
源代码24 项目: pacbot   文件: MailService.java
private MimeMessagePreparator buildMimeMessagePreparator(String from, List<String> to, String subject, String mailContent , final String attachmentUrl) {
	MimeMessagePreparator messagePreparator = mimeMessage -> {
		MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage, true);
		messageHelper.setFrom(from);
		String[] toMailList = to.toArray(new String[to.size()]);
		messageHelper.setTo(toMailList);
		messageHelper.setSubject(subject);
		messageHelper.setText(mailContent, true);
		if(StringUtils.isNotEmpty(attachmentUrl) && isHttpUrl(attachmentUrl)) {
			URL url = new URL(attachmentUrl);
			String filename = url.getFile();
			byte fileContent [] = getFileContent(url);
			messageHelper.addAttachment(filename, new ByteArrayResource(fileContent));
		}
	};
	return messagePreparator;
}
 
源代码25 项目: iaf   文件: MessagingSource.java
protected Connection createConnection() throws JMSException {
	if (StringUtils.isNotEmpty(authAlias)) {
		CredentialFactory cf = new CredentialFactory(authAlias,null,null);
		if (log.isDebugEnabled()) log.debug("using userId ["+cf.getUsername()+"] to create Connection");
		if (useJms102()) {
			if (connectionFactory instanceof QueueConnectionFactory) {
				return ((QueueConnectionFactory)connectionFactory).createQueueConnection(cf.getUsername(),cf.getPassword());
			} else {
				return ((TopicConnectionFactory)connectionFactory).createTopicConnection(cf.getUsername(),cf.getPassword());
			}
		} else {
			return connectionFactory.createConnection(cf.getUsername(),cf.getPassword());
		}
	}
	if (useJms102()) {
		if (connectionFactory instanceof QueueConnectionFactory) {
			return ((QueueConnectionFactory)connectionFactory).createQueueConnection();
		} else {
			return ((TopicConnectionFactory)connectionFactory).createTopicConnection();
		}
	} else {
		return connectionFactory.createConnection();
	}
}
 
源代码26 项目: carbon-identity-framework   文件: IdentityUtil.java
/**
 * Returns whether the passed operation is supported by userstore or not
 *
 * @param userStoreManager User Store
 * @param operation        Operation name
 * @return true if the operation is supported by userstore. False if it doesnt
 */
public static boolean isSupportedByUserStore(UserStoreManager userStoreManager, String operation) {
    boolean isOperationSupported = true;
    if (userStoreManager != null) {
        String isOperationSupportedProperty = userStoreManager.getRealmConfiguration().getUserStoreProperty
                (operation);
        if (StringUtils.isNotBlank(isOperationSupportedProperty)) {
            isOperationSupported = Boolean.parseBoolean(isOperationSupportedProperty);
        }
    }
    return isOperationSupported;
}
 
源代码27 项目: atlas   文件: ZipFileMigrationImporter.java
private int processZipFileStreamSizeComment(String comment) {
    if (StringUtils.isEmpty(comment)) {
        return 1;
    }

    Map map = AtlasType.fromJson(comment, Map.class);
    int entitiesCount = (int) map.get(ZIP_FILE_COMMENT_ENTITIES_COUNT);
    int totalCount = (int) map.get(ZIP_FILE_COMMENT_TOTAL_COUNT);
    LOG.info("ZipFileMigrationImporter: Zip file: Comment: streamSize: {}: total: {}", entitiesCount, totalCount);

    return entitiesCount;
}
 
源代码28 项目: youkefu   文件: NoticeBusinessController.java
@RequestMapping("/detail")
  @Menu(type = "notice" , subtype = "noticebus" )
  public ModelAndView detail(ModelMap map , HttpServletRequest request , @Valid String id , @Valid String msg, @Valid String sysmsmsg, @Valid String smsmsg, @Valid String mailmsg) throws SQLException {
if (!StringUtils.isBlank(id)) {
	Notice notice = noticeRes.findByIdAndOrgi(id, super.getOrgi(request));
	if (notice != null) {
		map.addAttribute("notice",notice) ;
	}
}
map.addAttribute("msg",msg) ;
map.addAttribute("sysmsmsg",sysmsmsg) ;
map.addAttribute("smsmsg",smsmsg) ;
map.addAttribute("mailmsg",mailmsg) ;
  	return request(super.createAppsTempletResponse("/apps/notice/detail"));
  }
 
源代码29 项目: zstack   文件: CdRomBootOrderAllocator.java
private int setCdRomBootOrder(List<KVMAgentCommands.CdRomTO> cdRoms, int bootOrderNum) {
    for (KVMAgentCommands.CdRomTO cdRom : cdRoms) {
        if (!cdRom.isEmpty() && StringUtils.isNotEmpty(cdRom.getPath())) {
            cdRom.setBootOrder(++bootOrderNum);
        }
    }
    return bootOrderNum;
}
 
源代码30 项目: rice   文件: LookupDefinition.java
/**
 * Sets title to the given value.
 *
 * @param title
 * @throws IllegalArgumentException if the given title is blank
 */
public void setTitle(String title) {
    if (StringUtils.isBlank(title)) {
        throw new IllegalArgumentException("invalid (blank) title");
    }
    this.title = title;
}