Creates a License object from the specified SpdxListedLicense object.
@param spdxListedLicense the object to convert
@return a CycloneDX License object
338817
private static License createLicenseObject(SpdxListedLicense spdxListedLicense) {
        final License license = new License();
        license.setId(spdxListedLicense.getLicenseId());
        license.setName(spdxListedLicense.getName());
        if (spdxListedLicense.getSeeAlso() != null && spdxListedLicense.getSeeAlso().length > 0) {
            license.setUrl(spdxListedLicense.getSeeAlso()[0]);
        }
        if (spdxListedLicense.getLicenseText() != null) {
            final LicenseText text = new LicenseText();
            text.setContentType("plain/text");
            text.setEncoding("base64");
            text.setText(Base64.getEncoder().encodeToString(spdxListedLicense.getLicenseText().getBytes()));
            license.setLicenseText(text);
        }
        return license;
    }
89550
public static com.liferay.commerce.product.model.CPDefinition createCPDefinition(
		long CPDefinitionId) {
		return getService().createCPDefinition(CPDefinitionId);
	}
256756
public final CartLn makeTxdLine(final List<CartLn> pTxdLns, final Long pTdlId,
    final Long pCatId,  final Tax pTax, final Double pPercent,
      final AccSettings pAs) {
    CartLn txdLn = null;
    for (CartLn tdl : pTxdLns) {
      if (tdl.getItsId().equals(pTdlId)) {
        txdLn = tdl;
      }
    }
    if (txdLn == null) {
      txdLn = new CartLn();
      txdLn.setItsId(pTdlId);
      InvItemTaxCategory tc = new InvItemTaxCategory();
      tc.setItsId(pCatId);
      tc.setTaxes(new ArrayList<InvItemTaxCategoryLine>());
      txdLn.setTxCat(tc);
      pTxdLns.add(txdLn);
    }
    InvItemTaxCategoryLine itcl = new InvItemTaxCategoryLine();
    itcl.setTax(pTax);
    itcl.setItsPercentage(BigDecimal.valueOf(pPercent)
      .setScale(pAs.getTaxPrecision(), RoundingMode.HALF_UP));
    txdLn.getTxCat().getTaxes().add(itcl);
    txdLn.getTxCat().setAggrOnlyPercent(txdLn.getTxCat()
      .getAggrOnlyPercent().add(itcl.getItsPercentage()));
    return txdLn;
  }
164626
private Collection<LicenseHistogramDataPoint> createLicenseHistogram(BaseCheckPoliciesResult result) {
        Collection<LicenseHistogramDataPoint> dataPoints = new ArrayList<LicenseHistogramDataPoint>();

        // create distribution histogram
        Map<String, Integer> licenseHistogram = new HashMap<String, Integer>();
        for (Map.Entry<String, Collection<ResourceInfo>> entry : result.getProjectNewResources().entrySet()) {
            for (ResourceInfo resource : entry.getValue()) {
                for (String license : resource.getLicenses()) {
                    licenseHistogram.put(license, MapUtils.getInteger(licenseHistogram, license, 0) + 1);
                }
            }
        }

        // sort by count descending
        List<Map.Entry<String, Integer>> licenses = new ArrayList<Map.Entry<String, Integer>>(licenseHistogram.entrySet());
        Collections.sort(licenses, new ValueComparator());

        // create data points
        if (!licenses.isEmpty()) {
            // first licenses
            for (Map.Entry<String, Integer> entry : licenses.subList(0, Math.min(LICENSE_LIMIT, licenses.size()))) {
                dataPoints.add(new LicenseHistogramDataPoint(entry.getKey(), entry.getValue()));
            }

            // aggregation of histogram tail
            int tailSize = licenses.size() - LICENSE_LIMIT;
            int tailSum = 0;
            if (tailSize > 0) {
                for (Map.Entry<String, Integer> entry : licenses.subList(LICENSE_LIMIT, licenses.size())) {
                    tailSum += entry.getValue();
                }
                dataPoints.add(new LicenseHistogramDataPoint(OTHER_LICENSE + " (" + tailSize + ")", tailSum));
            }

            // normalize bar height
            float factor = MAX_BAR_HEIGHT / (float) Math.max(tailSum, licenses.get(0).getValue());
            for (LicenseHistogramDataPoint dataPoint : dataPoints) {
                dataPoint.setHeight((int) (factor * dataPoint.getOccurrences()));
            }
        }

        return dataPoints;
    }
1208860
public LicenseTemplate getSingleLicenseTemplate(String key) throws GitLabApiException {
        Response response = get(Response.Status.OK, null, "licenses", key);
        return (response.readEntity(LicenseTemplate.class));
    }
422226
public static com.liferay.commerce.product.model.CPDefinitionLink createCPDefinitionLink(
		long CPDefinitionLinkId) {
		return getService().createCPDefinitionLink(CPDefinitionLinkId);
	}
135216
public void setRemoveLicenseSpecifications(java.util.Collection<LicenseSpecification> removeLicenseSpecifications) {
        if (removeLicenseSpecifications == null) {
            this.removeLicenseSpecifications = null;
            return;
        }

        this.removeLicenseSpecifications = new java.util.ArrayList<LicenseSpecification>(removeLicenseSpecifications);
    }
735168
public com.google.api.ads.admanager.axis.v201805.ThirdPartyAudienceSegmentLicenseType getLicenseType() {
        return licenseType;
    }
1068932
@Override
    protected LicenseProvider createLicenseProvider(String licenseAgreementPrefix, String licenseInformationPrefix,
                                                    String subsystemLicenseType) {
        String featureLicenseAgreementPrefix = this.featureName + "/" + licenseAgreementPrefix;
        String featureLicenseInformationPrefix = licenseInformationPrefix == null ? null : this.featureName + "/" + licenseInformationPrefix;
        if (featureLicenseInformationPrefix == null) {
            LicenseProvider lp = ZipLicenseProvider.createInstance(zip, featureLicenseAgreementPrefix);
            if (lp != null)
                return lp;
        } else {
            wlp.lib.extract.ReturnCode licenseReturnCode = ZipLicenseProvider.buildInstance(zip, featureLicenseAgreementPrefix,
                                                                                            featureLicenseInformationPrefix);
            if (licenseReturnCode == wlp.lib.extract.ReturnCode.OK) {
                // Everything is set up ok so carry on
                return ZipLicenseProvider.getInstance();
            }
        }
        // An error indicates that the IBM licenses could not be found so we can use the subsystem header
        if (subsystemLicenseType != null && subsystemLicenseType.length() > 0) {
            return new ThirdPartyLicenseProvider(featureDefinition.getFeatureName(), subsystemLicenseType);
        }
        return null;
    }
1324255
public License getLicense(final DbLicense dbLicense) {
        final License license = DataModelFactory.createLicense(dbLicense.getName(), dbLicense.getLongName(),
            dbLicense.getComments(), dbLicense.getRegexp(), dbLicense.getUrl());

        if (dbLicense.isApproved() != null) {
            license.setApproved(dbLicense.isApproved());
        }else{
            license.setPending(true);
        }

        if (license.getLongName().isEmpty() && license.getComments().isEmpty() && license.getUrl().isEmpty()
            && license.getRegexp().isEmpty()) {
            license.setUnknown(true);
        }

        return license;
    }
564470
public Object displayLicenseFile(InputStream licenseFile, CommandConsole commandConsole) {
        Object e = LicenseUtility.class;
        if (licenseFile != null) {
            e = showLicenseFile(licenseFile, commandConsole);
        }
        if (e != null) {
            commandConsole.printErrorMessage(CommandUtils.getMessage("LICENSE_NOT_FOUND"));
        }
        return e;
    }
313841
@Override
	public com.liferay.commerce.product.model.CPFriendlyURLEntry createCPFriendlyURLEntry(
		long CPFriendlyURLEntryId) {
		return _cpFriendlyURLEntryLocalService.createCPFriendlyURLEntry(CPFriendlyURLEntryId);
	}
545306
@Override
	public com.liferay.commerce.model.CPDefinitionInventory createCPDefinitionInventory(
		long CPDefinitionInventoryId) {
		return _cpDefinitionInventoryLocalService.createCPDefinitionInventory(CPDefinitionInventoryId);
	}
889923
private License getLicense(final String licenseId) {
        License result = null;
        final Set<DbLicense> matchingLicenses = licenseMatcher.getMatchingLicenses(licenseId);

        if (matchingLicenses.isEmpty()) {
            result = DataModelFactory.createLicense("#" + licenseId + "# (to be identified)", NOT_IDENTIFIED_YET, NOT_IDENTIFIED_YET, NOT_IDENTIFIED_YET, NOT_IDENTIFIED_YET);
            result.setUnknown(true);
        } else {
            if (matchingLicenses.size() > 1 && LOG.isWarnEnabled()) {
                LOG.warn(String.format("%s matches multiple licenses %s. " +
                                "Please run the report showing multiple matching on licenses",
                        licenseId, matchingLicenses.toString()));
            }
            result = mapper.getLicense(matchingLicenses.iterator().next());

        }

        return result;
    }
178
protected function generateLicense()
    {
        $command = $this->prepareSignCommand() . ' 2>&1';

        $this->log('Creating license at ' . $this->outputFile);

        $this->log('Running: ' . $command, Project::MSG_VERBOSE);
        $tmp = exec($command, $output, $return_var);

        // Check for exit value 1. Zendenc_sign command for some reason
        // returns 0 in case of failure and 1 in case of success...
        if ($return_var !== 1) {
            throw new BuildException("Creating license failed. \n\nZendenc_sign msg:\n" . implode(
                "\n",
                $output
            ) . "\n\n");
        }
    }
808899
@Override
	public com.liferay.commerce.product.model.CPSpecificationOption createCPSpecificationOption(
		long CPSpecificationOptionId) {
		return _cpSpecificationOptionLocalService.createCPSpecificationOption(CPSpecificationOptionId);
	}
793674
private void addLicenses(MavenPomDescriptor pomDescriptor, Model model, Store store) {
        List<License> licenses = model.getLicenses();
        for (License license : licenses) {
            MavenLicenseDescriptor licenseDescriptor = store.create(MavenLicenseDescriptor.class);
            licenseDescriptor.setUrl(license.getUrl());
            licenseDescriptor.setComments(license.getComments());
            licenseDescriptor.setName(license.getName());
            licenseDescriptor.setDistribution(license.getDistribution());

            pomDescriptor.getLicenses().add(licenseDescriptor);
        }
    }