public static License find(final LicenseVerifierCallback callback) { try { final String clazz = preferences.getProperty("factory.licensefactory.class"); try { final Class<LicenseFactory> name = (Class<LicenseFactory>) Class.forName(clazz); final List<License> list = new ArrayList<License>(name.newInstance().open()); list.removeIf(key -> !key.verify(callback)); if(list.isEmpty()) { return LicenseFactory.EMPTY_LICENSE; } return list.iterator().next(); } catch(InstantiationException | ClassNotFoundException | IllegalAccessException e) { throw new FactoryException(e.getMessage(), e); } } catch(AccessDeniedException e) { log.warn(String.format("Failure finding receipt %s", e.getMessage())); } return LicenseFactory.EMPTY_LICENSE; }
@Override public List<Header> headers() throws AccessDeniedException, MissingReceiptException, InvalidReceiptException { final List<License> receipts = factory.open(); if(receipts.isEmpty()) { throw new MissingReceiptException(); } final List<Header> headers = new ArrayList<Header>(); for(License receipt : receipts) { if(log.isInfoEnabled()) { log.info(String.format("Using voucher %s", receipt)); } if(!receipt.verify(new DisabledLicenseVerifierCallback())) { throw new InvalidReceiptException(); } headers.add(new Header(Headers.HEADER_VOUCHER, receipt.getValue("Voucher"))); } return headers; }
if(!key.verify(new DisabledLicenseVerifierCallback())) { final String lastversion = preferences.getProperty("donate.reminder"); if(NSBundle.mainBundle().infoDictionary().objectForKey("CFBundleShortVersionString").toString().equals(lastversion)) {
public static void print(final Preferences preferences) { final Console console = new Console(); final License l = LicenseFactory.find(); console.printf("%s %s (%s). %s%n", preferences.getProperty("application.name"), preferences.getProperty("application.version"), preferences.getProperty("application.revision"), l.verify(new DisabledLicenseVerifierCallback()) ? l.toString() : "Not registered. Purchase a donation key to support the development of this software."); } }
final License l = LicenseFactory.find(); footer.append(StringUtils.LF); if(l.verify(new DisabledLicenseVerifierCallback())) { footer.append(l.toString());
if(l.verify(new DisabledLicenseVerifierCallback())) { try { f.copy(LocalFactory.get(SupportDirectoryFinderFactory.get().find(), f.getName()));