protected void finished() { if (isValidXML()) { licenses.add(MetadataFactory.createLicense(location, getText())); } } }
protected void finished() { if (isValidXML()) { licenses.add(MetadataFactory.createLicense(location, getText())); } } }
protected void finished() { if (isValidXML()) { licenses.add(MetadataFactory.createLicense(location, getText())); } } }
private ILicense getLicense(IInstallableUnit iu, ILicense license, String locale) { String body = (license != null ? license.getBody() : null); if (body == null || body.length() <= 1 || body.charAt(0) != '%') return license; final String actualKey = body.substring(1); // Strip off the % body = getLocalizedIUProperty(iu, actualKey, locale); return MetadataFactory.createLicense(license.getLocation(), body); }
private void parseLicense(String prefix, List<ILicense> licenses) { String body = currentValue(); next(); prefix += '.'; String location = null; if (current != null && current.startsWith(prefix)) { if (current.substring(prefix.length()).equals(LOCATION)) { location = currentValue(); } else { // we ignore elements we do not understand } next(); } try { URI uri = location != null ? new URI(location) : null; ILicense license = MetadataFactory.createLicense(uri, body); licenses.add(license); } catch (URISyntaxException e) { throw new IllegalStateException("bad license URI at token: " + current + ", " + currentValue()); //$NON-NLS-1$ //$NON-NLS-2$ } }
private void parseLicense(String prefix, List<ILicense> licenses) { String body = currentValue(); next(); prefix += '.'; String location = null; if (current != null && current.startsWith(prefix)) { if (current.substring(prefix.length()).equals(LOCATION)) { location = currentValue(); } else { // we ignore elements we do not understand } next(); } try { URI uri = location != null ? new URI(location) : null; ILicense license = MetadataFactory.createLicense(uri, body); licenses.add(license); } catch (URISyntaxException e) { throw new IllegalStateException("bad license URI at token: " + current + ", " + currentValue()); //$NON-NLS-1$ //$NON-NLS-2$ } }
private void parseLicense(String prefix, List<ILicense> licenses) { String body = currentValue(); next(); prefix += '.'; String location = null; if (current != null && current.startsWith(prefix)) { if (current.substring(prefix.length()).equals(LOCATION)) { location = currentValue(); } else { // we ignore elements we do not understand } next(); } try { URI uri = location != null ? new URI(location) : null; ILicense license = MetadataFactory.createLicense(uri, body); licenses.add(license); } catch (URISyntaxException e) { throw new IllegalStateException("bad license URI at token: " + current + ", " + currentValue()); //$NON-NLS-1$ //$NON-NLS-2$ } }
private void parseLicense(String prefix, List<ILicense> licenses) { String body = currentValue(); next(); prefix += '.'; String location = null; if (current != null && current.startsWith(prefix)) { if (current.substring(prefix.length()).equals(LOCATION)) { location = currentValue(); } else { // we ignore elements we do not understand } next(); } try { URI uri = location != null ? new URI(location) : null; ILicense license = MetadataFactory.createLicense(uri, body); licenses.add(license); } catch (URISyntaxException e) { throw new IllegalStateException("bad license URI at token: " + current + ", " + currentValue()); //$NON-NLS-1$ //$NON-NLS-2$ } }
protected static void processLicense(InstallableUnitDescription iu, IPublisherInfo info) { Collection<ILicenseAdvice> advice = info.getAdvice(null, true, iu.getId(), iu.getVersion(), ILicenseAdvice.class); if (advice.size() > 0) { // Only process the first license we find for this IU. ILicenseAdvice entry = advice.iterator().next(); String licenseText = entry.getLicenseText() == null ? "" : entry.getLicenseText(); //$NON-NLS-1$ String licenseUrl = entry.getLicenseURL() == null ? "" : entry.getLicenseURL(); //$NON-NLS-1$ if (licenseText.length() > 0 || licenseUrl.length() > 0) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(licenseUrl), licenseText)}); } }
protected static void processLicense(InstallableUnitDescription iu, IPublisherInfo info) { Collection<ILicenseAdvice> advice = info.getAdvice(null, true, iu.getId(), iu.getVersion(), ILicenseAdvice.class); if (advice.size() > 0) { // Only process the first license we find for this IU. ILicenseAdvice entry = advice.iterator().next(); String licenseText = entry.getLicenseText() == null ? "" : entry.getLicenseText(); //$NON-NLS-1$ String licenseUrl = entry.getLicenseURL() == null ? "" : entry.getLicenseURL(); //$NON-NLS-1$ if (licenseText.length() > 0 || licenseUrl.length() > 0) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(licenseUrl), licenseText)}); } }
protected static void processLicense(InstallableUnitDescription iu, IPublisherInfo info) { Collection<ILicenseAdvice> advice = info.getAdvice(null, true, iu.getId(), iu.getVersion(), ILicenseAdvice.class); if (advice.size() > 0) { // Only process the first license we find for this IU. ILicenseAdvice entry = advice.iterator().next(); String licenseText = entry.getLicenseText() == null ? "" : entry.getLicenseText(); //$NON-NLS-1$ String licenseUrl = entry.getLicenseURL() == null ? "" : entry.getLicenseURL(); //$NON-NLS-1$ if (licenseText.length() > 0 || licenseUrl.length() > 0) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(licenseUrl), licenseText)}); } }
protected static void processLicense(InstallableUnitDescription iu, IPublisherInfo info) { Collection<ILicenseAdvice> advice = info.getAdvice(null, true, iu.getId(), iu.getVersion(), ILicenseAdvice.class); if (advice.size() > 0) { // Only process the first license we find for this IU. ILicenseAdvice entry = advice.iterator().next(); String licenseText = entry.getLicenseText() == null ? "" : entry.getLicenseText(); //$NON-NLS-1$ String licenseUrl = entry.getLicenseURL() == null ? "" : entry.getLicenseURL(); //$NON-NLS-1$ if (licenseText.length() > 0 || licenseUrl.length() > 0) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(licenseUrl), licenseText)}); } }
iu.setProperty(IInstallableUnit.PROP_PROVIDER, feature.getProviderName()); if (feature.getLicense() != null) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(feature.getLicenseURL()), feature.getLicense())}); if (feature.getCopyright() != null) iu.setCopyright(MetadataFactory.createCopyright(toURIOrNull(feature.getCopyrightURL()), feature.getCopyright()));
iu.setProperty(IInstallableUnit.PROP_PROVIDER, feature.getProviderName()); if (feature.getLicense() != null) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(feature.getLicenseURL()), feature.getLicense())}); if (feature.getCopyright() != null) iu.setCopyright(MetadataFactory.createCopyright(toURIOrNull(feature.getCopyrightURL()), feature.getCopyright()));
iu.setProperty(IInstallableUnit.PROP_PROVIDER, feature.getProviderName()); if (feature.getLicense() != null) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(feature.getLicenseURL()), feature.getLicense())}); if (feature.getCopyright() != null) iu.setCopyright(MetadataFactory.createCopyright(toURIOrNull(feature.getCopyrightURL()), feature.getCopyright()));
iu.setProperty(IInstallableUnit.PROP_PROVIDER, feature.getProviderName()); if (feature.getLicense() != null) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(feature.getLicenseURL()), feature.getLicense())}); if (feature.getCopyright() != null) iu.setCopyright(MetadataFactory.createCopyright(toURIOrNull(feature.getCopyrightURL()), feature.getCopyright()));
iu.setProperty(IInstallableUnit.PROP_PROVIDER, feature.getProviderName()); if (feature.getLicense() != null) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(feature.getLicenseURL()), feature.getLicense())}); if (feature.getCopyright() != null) iu.setCopyright(MetadataFactory.createCopyright(toURIOrNull(feature.getCopyrightURL()), feature.getCopyright()));
iu.setProperty(IInstallableUnit.PROP_PROVIDER, feature.getProviderName()); if (feature.getLicense() != null) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(feature.getLicenseURL()), feature.getLicense())}); if (feature.getCopyright() != null) iu.setCopyright(MetadataFactory.createCopyright(toURIOrNull(feature.getCopyrightURL()), feature.getCopyright()));
iu.setProperty(IInstallableUnit.PROP_PROVIDER, feature.getProviderName()); if (feature.getLicense() != null) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(feature.getLicenseURL()), feature.getLicense())}); if (feature.getCopyright() != null) iu.setCopyright(MetadataFactory.createCopyright(toURIOrNull(feature.getCopyrightURL()), feature.getCopyright()));
iu.setProperty(IInstallableUnit.PROP_PROVIDER, feature.getProviderName()); if (feature.getLicense() != null) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(feature.getLicenseURL()), feature.getLicense())}); if (feature.getCopyright() != null) iu.setCopyright(MetadataFactory.createCopyright(toURIOrNull(feature.getCopyrightURL()), feature.getCopyright()));