eu.europa.esig.dss.utils.Utils.isCollectionEmpty()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中eu.europa.esig.dss.utils.Utils.isCollectionEmpty()方法的一些代码示例,展示了Utils.isCollectionEmpty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.isCollectionEmpty()方法的具体详情如下:
包路径:eu.europa.esig.dss.utils.Utils
类名称:Utils
方法名:isCollectionEmpty

Utils.isCollectionEmpty介绍

暂无

代码示例

代码示例来源:origin: esig/dss

private List<String> emptyToNull(List<String> listUrls) {
  if (Utils.isCollectionEmpty(listUrls)) {
    return null;
  }
  return listUrls;
}

代码示例来源:origin: esig/dss

@Override
protected boolean process() {
  List<String> commitmentTypeIdentifiers = signature.getCommitmentTypeIdentifiers();
  List<String> expectedValues = constraint.getId();
  if (Utils.isCollectionEmpty(commitmentTypeIdentifiers)) {
    return false;
  }
  if (Utils.isCollectionNotEmpty(expectedValues)) {
    return expectedValues.containsAll(commitmentTypeIdentifiers);
  }
  return true;
}

代码示例来源:origin: esig/dss

@Override
protected boolean process() {
  if ("ASiC-S".equals(containerInfo.getContainerType())) { // ASiC-S no Manifest
    message = MessageTag.BBB_FC_IMFP_ASICS;
    error = MessageTag.BBB_FC_IMFP_ASICS_ANS;
    return Utils.isCollectionEmpty(containerInfo.getManifestFiles());
  } else { // ASiC-E one or more manifest
    message = MessageTag.BBB_FC_IMFP_ASICE;
    error = MessageTag.BBB_FC_IMFP_ASICE_ANS;
    return Utils.isCollectionNotEmpty(containerInfo.getManifestFiles());
  }
}

代码示例来源:origin: esig/dss

List<String> urls = DSSASN1Utils.getCAAccessLocations(cert);
if (Utils.isCollectionEmpty(urls)) {
  LOG.info("There is no AIA extension for certificate download.");
  return Collections.emptyList();

代码示例来源:origin: esig/dss

@Test
public void isCollectionEmpty() {
  assertTrue(Utils.isCollectionEmpty(null));
  assertTrue(Utils.isCollectionEmpty(new ArrayList<String>()));
  List<String> list = new ArrayList<String>();
  list.add("a");
  list.add("b");
  list.add("c");
  assertFalse(Utils.isCollectionEmpty(list));
}

代码示例来源:origin: esig/dss

if (Utils.isCollectionEmpty(crlUrls) && Utils.isCollectionEmpty(alternativeUrls)) {
  LOG.debug("No CRL location found for {}", dssIdAsString);
  return null;

代码示例来源:origin: esig/dss

if (Utils.isCollectionEmpty(crlUrls)) {
  return null;

代码示例来源:origin: esig/dss

@Test
public void noCAQC() {
  ServiceByDateFilter filter = new ServiceByDateFilter(DATE2);
  assertTrue(Utils.isCollectionEmpty(filter.filter(new ArrayList<TrustedServiceWrapper>())));
}

代码示例来源:origin: esig/dss

@Override
public final OCSPToken getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken) {
  final List<BasicOCSPResp> containedOCSPResponses = getContainedOCSPResponses();
  if (Utils.isCollectionEmpty(containedOCSPResponses)) {
    return null;

代码示例来源:origin: esig/dss

@Test
public void testCannotConclude() {
  CertificateWrapper emptyCert = new MockCertificateWrapper(AFTER_EIDAS_DATE, Collections.<String> emptyList(), Collections.<String> emptyList(),
      Collections.<String> emptyList());
  UniqueServiceFilter filter = new UniqueServiceFilter(emptyCert);
  List<TrustedServiceWrapper> trustServices = new ArrayList<TrustedServiceWrapper>();
  TrustedServiceWrapper ts0 = new TrustedServiceWrapper();
  ts0.setCapturedQualifiers(Arrays.asList(ServiceQualification.QC_STATEMENT, ServiceQualification.QC_WITH_QSCD, ServiceQualification.QC_FOR_ESIG));
  trustServices.add(ts0);
  TrustedServiceWrapper ts1 = new TrustedServiceWrapper();
  ts1.setCapturedQualifiers(
      Arrays.asList(ServiceQualification.QC_STATEMENT, ServiceQualification.QC_QSCD_MANAGED_ON_BEHALF, ServiceQualification.QC_FOR_ESEAL));
  trustServices.add(ts1);
  List<TrustedServiceWrapper> filtered = filter.filter(trustServices);
  assertTrue(Utils.isCollectionEmpty(filtered));
}

代码示例来源:origin: esig/dss

if (Utils.isCollectionEmpty(ocspAccessLocations) && Utils.isCollectionEmpty(alternativeUrls)) {
  LOG.debug("No OCSP location found for {}", dssIdAsString);
  return null;

代码示例来源:origin: esig/dss

@Test
public void listFiles() {
  File folder = new File("src/main/java");
  String[] extensions = new String[] { "java" };
  Collection<File> listFiles = Utils.listFiles(folder, extensions, true);
  assertTrue(Utils.isCollectionNotEmpty(listFiles));
  extensions = new String[] { "doc", "pdf" };
  listFiles = Utils.listFiles(folder, extensions, true);
  assertTrue(Utils.isCollectionEmpty(listFiles));
}

代码示例来源:origin: esig/dss

@Test
public void getQCStatementsIdList() {
  List<String> qcStatementsIdList = DSSASN1Utils.getQCStatementsIdList(certificateWithAIA);
  assertTrue(Utils.isCollectionEmpty(qcStatementsIdList));
  CertificateToken certificate = DSSUtils.loadCertificate(new File("src/test/resources/ec.europa.eu.crt"));
  qcStatementsIdList = DSSASN1Utils.getQCStatementsIdList(certificate);
  assertTrue(Utils.isCollectionNotEmpty(qcStatementsIdList));
  assertTrue(qcStatementsIdList.contains(ETSIQCObjectIdentifiers.id_etsi_qcs_LimiteValue.getId()));
}

相关文章