本文整理汇总了Java中eu.europa.esig.dss.utils.Utils.isStringNotEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.isStringNotEmpty方法的具体用法?Java Utils.isStringNotEmpty怎么用?Java Utils.isStringNotEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eu.europa.esig.dss.utils.Utils
的用法示例。
在下文中一共展示了Utils.isStringNotEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractPOE
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
public void extractPOE(TimestampWrapper timestamp, DiagnosticData diagnosticData) {
Date productionTime = timestamp.getProductionTime();
List<XmlTimestampedObject> timestampedObjects = timestamp.getTimestampedObjects();
if (Utils.isCollectionNotEmpty(timestampedObjects)) {
for (XmlTimestampedObject xmlTimestampedObject : timestampedObjects) {
if (Utils.isStringNotEmpty(xmlTimestampedObject.getId())) {
// SIGNATURES and TIMESTAMPS
addPOE(xmlTimestampedObject.getId(), productionTime);
} else if (TimestampedObjectType.CERTIFICATE == xmlTimestampedObject.getCategory()) {
String certificateId = getCertificateIdByDigest(xmlTimestampedObject.getDigestAlgoAndValue(), diagnosticData);
if (certificateId != null) {
addPOE(certificateId, productionTime);
}
} else if (TimestampedObjectType.REVOCATION == xmlTimestampedObject.getCategory()) {
String revocationId = getRevocationIdByDigest(xmlTimestampedObject.getDigestAlgoAndValue(), diagnosticData);
if (revocationId != null) {
addPOE(revocationId, productionTime);
}
}
}
}
}
示例2: getReadableCertificateName
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
private String getReadableCertificateName(String certId) {
CertificateWrapper signingCert = diagnosticData.getUsedCertificateById(certId);
if (signingCert != null) {
if (Utils.isStringNotEmpty(signingCert.getCommonName())) {
return signingCert.getCommonName();
}
if (Utils.isStringNotEmpty(signingCert.getGivenName())) {
return signingCert.getGivenName();
}
if (Utils.isStringNotEmpty(signingCert.getSurname())) {
return signingCert.getSurname();
}
if (Utils.isStringNotEmpty(signingCert.getPseudo())) {
return signingCert.getPseudo();
}
if (Utils.isStringNotEmpty(signingCert.getOrganizationName())) {
return signingCert.getOrganizationName();
}
if (Utils.isStringNotEmpty(signingCert.getOrganizationalUnit())) {
return signingCert.getOrganizationalUnit();
}
}
return "?";
}
示例3: getParentNodeOfSignature
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
@Override
protected Node getParentNodeOfSignature() {
final String xPathLocationString = params.getXPathLocationString();
if (Utils.isStringNotEmpty(xPathLocationString)) {
return DomUtils.getElement(documentDom, xPathLocationString);
}
return documentDom.getDocumentElement();
}
示例4: getSubFilter
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
@Override
protected COSName getSubFilter(PAdESSignatureParameters parameters) {
if (Utils.isStringNotEmpty(parameters.getTimestampSubFilter())) {
return COSName.getPDFName(parameters.getTimestampSubFilter());
}
return SUB_FILTER_ETSI_RFC3161;
}
示例5: getAdditionalInfo
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
@Override
protected String getAdditionalInfo() {
if (Utils.isStringNotEmpty(serviceTypeStr)) {
Object[] params = new Object[] { serviceTypeStr };
return MessageFormat.format(AdditionalInfo.TRUSTED_SERVICE_TYPE, params);
}
return null;
}
示例6: getAllCounterSignatures
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
/**
* This method returns counter-signatures (not signatures)
*
* @return
*/
public Set<SignatureWrapper> getAllCounterSignatures() {
Set<SignatureWrapper> signatures = new HashSet<SignatureWrapper>();
List<SignatureWrapper> mixedSignatures = getSignatures();
for (SignatureWrapper signatureWrapper : mixedSignatures) {
if (Utils.isStringNotEmpty(signatureWrapper.getParentId())) {
signatures.add(signatureWrapper);
}
}
return signatures;
}
示例7: getPseudo
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
@Override
public String getPseudo(CertificateWrapper certificate) {
for (PseudoStrategy strategy : STRATEGIES) {
String pseudo = strategy.getPseudo(certificate);
if (Utils.isStringNotEmpty(pseudo)) {
return pseudo;
}
}
return null;
}
示例8: getAdditionalInfo
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
@Override
protected String getAdditionalInfo() {
if (Utils.isStringNotEmpty(pseudo)) {
Object[] params = new Object[] { pseudo };
return MessageFormat.format(AdditionalInfo.PSEUDO, params);
}
return null;
}
示例9: processValueCheck
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
protected boolean processValueCheck(String value) {
List<String> expecteds = constraint.getId();
if (Utils.isStringNotEmpty(value) && Utils.isCollectionNotEmpty(expecteds)) {
if (expecteds.contains(ALL_VALUE)) {
return true;
} else if (expecteds.contains(value)) {
return true;
}
}
return false;
}
示例10: getExpirationDate
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
private Date getExpirationDate(String algoToFind, List<Algo> algos, String format) {
SimpleDateFormat dateFormat = new SimpleDateFormat(Utils.isStringEmpty(format) ? DATE_FORMAT : format);
Date result = null;
for (Algo algo : algos) {
if (Utils.areStringsEqual(algoToFind, algo.getValue()) && Utils.isStringNotEmpty(algo.getDate())) {
try {
result = dateFormat.parse(algo.getDate());
} catch (Exception e) {
LOG.warn("Unable to parse date with pattern '" + dateFormat.toPattern() + "' : " + e.getMessage());
}
}
}
return result;
}
示例11: process
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
@Override
protected boolean process() {
String policyId = signature.getPolicyId();
if (multiValues.getId().contains(SignaturePolicy.NO_POLICY) && Utils.isStringEmpty(policyId)) {
return true;
} else if (multiValues.getId().contains(SignaturePolicy.ANY_POLICY) && Utils.isStringNotEmpty(policyId)) {
return true;
} else if (multiValues.getId().contains(SignaturePolicy.IMPLICIT_POLICY) && Utils.areStringsEqual(SignaturePolicy.IMPLICIT_POLICY, policyId)) {
return true;
}
// oids
return processValueCheck(policyId);
}
示例12: getFilter
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
protected COSName getFilter(PAdESSignatureParameters parameters) {
if (Utils.isStringNotEmpty(parameters.getSignatureFilter())) {
return COSName.getPDFName(parameters.getSignatureFilter());
}
return PDSignature.FILTER_ADOBE_PPKLITE;
}
示例13: create
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
public static ImageAndResolution create(final SignatureImageParameters imageParameters) throws IOException {
SignatureImageTextParameters textParamaters = imageParameters.getTextParameters();
DSSDocument image = imageParameters.getImage();
if ((textParamaters != null) && Utils.isStringNotEmpty(textParamaters.getText())) {
BufferedImage buffImg = ImageTextWriter.createTextImage(textParamaters.getText(), textParamaters.getFont(), textParamaters.getTextColor(),
textParamaters.getBackgroundColor(), getDpi(imageParameters.getDpi()), textParamaters.getSignerTextHorizontalAlignment());
if (image != null) {
try (InputStream is = image.openStream()) {
if (is != null) {
switch (textParamaters.getSignerNamePosition()) {
case LEFT:
buffImg = ImagesMerger.mergeOnRight(ImageIO.read(is), buffImg, textParamaters.getBackgroundColor(),
imageParameters.getSignerTextImageVerticalAlignment());
break;
case RIGHT:
buffImg = ImagesMerger.mergeOnRight(buffImg, ImageIO.read(is), textParamaters.getBackgroundColor(),
imageParameters.getSignerTextImageVerticalAlignment());
break;
case TOP:
buffImg = ImagesMerger.mergeOnTop(ImageIO.read(is), buffImg, textParamaters.getBackgroundColor());
break;
case BOTTOM:
buffImg = ImagesMerger.mergeOnTop(buffImg, ImageIO.read(is), textParamaters.getBackgroundColor());
break;
default:
break;
}
}
}
}
return convertToInputStream(buffImg, getDpi(imageParameters.getDpi()));
}
// Image only
return readAndDisplayMetadata(image);
}
示例14: getXmlStructuralValidation
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
private XmlStructuralValidation getXmlStructuralValidation(AdvancedSignature signature) {
String structureValidationResult = signature.getStructureValidationResult();
final XmlStructuralValidation xmlStructuralValidation = new XmlStructuralValidation();
xmlStructuralValidation.setValid(Utils.isStringEmpty(structureValidationResult));
if (Utils.isStringNotEmpty(structureValidationResult)) {
xmlStructuralValidation.setMessage(structureValidationResult);
}
return xmlStructuralValidation;
}
示例15: getXmlRevocation
import eu.europa.esig.dss.utils.Utils; //导入方法依赖的package包/类
private XmlRevocation getXmlRevocation(RevocationToken revocationToken, String xmlId, Set<DigestAlgorithm> usedDigestAlgorithms) {
final XmlRevocation xmlRevocation = new XmlRevocation();
xmlRevocation.setId(xmlId);
xmlRevocation.setOrigin(revocationToken.getOrigin().name());
final Boolean revocationTokenStatus = revocationToken.getStatus();
// revocationTokenStatus can be null when OCSP return Unknown. In
// this case we set status to false.
xmlRevocation.setStatus(revocationTokenStatus == null ? false : revocationTokenStatus);
xmlRevocation.setProductionDate(revocationToken.getProductionDate());
xmlRevocation.setThisUpdate(revocationToken.getThisUpdate());
xmlRevocation.setNextUpdate(revocationToken.getNextUpdate());
xmlRevocation.setRevocationDate(revocationToken.getRevocationDate());
xmlRevocation.setExpiredCertsOnCRL(revocationToken.getExpiredCertsOnCRL());
xmlRevocation.setArchiveCutOff(revocationToken.getArchiveCutOff());
xmlRevocation.setReason(revocationToken.getReason());
xmlRevocation.setSource(revocationToken.getClass().getSimpleName());
String sourceURL = revocationToken.getSourceURL();
if (Utils.isStringNotEmpty(sourceURL)) { // not empty = online
xmlRevocation.setSourceAddress(sourceURL);
xmlRevocation.setAvailable(revocationToken.isAvailable());
}
xmlRevocation.setBasicSignature(getXmlBasicSignature(revocationToken));
xmlRevocation.setDigestAlgoAndValues(getXmlDigestAlgoAndValues(usedDigestAlgorithms, revocationToken));
final CertificateToken issuerToken = revocationToken.getIssuerToken();
xmlRevocation.setSigningCertificate(getXmlSigningCertificate(issuerToken));
xmlRevocation.setCertificateChain(getXmlForCertificateChain(issuerToken));
xmlRevocation.setInfo(getXmlInfo(revocationToken.getValidationInfo()));
return xmlRevocation;
}