@Test public void testOpenDirectory() throws Exception { assertEquals(1, new ReceiptFactory(new Local("/Applications/Cyberduck.app/Contents/_MASReceipt")).open().size()); }
@Override protected License open(final Local file) { final ReceiptVerifier verifier = new ReceiptVerifier(file); if(verifier.verify(new DisabledLicenseVerifierCallback())) { final Receipt receipt = new Receipt(file, verifier.getGuid()); if(log.isInfoEnabled()) { log.info(String.format("Valid receipt %s in %s", receipt, file)); } final Local support = SupportDirectoryFinderFactory.get().find(); try { file.copy(LocalFactory.get(support, String.format("%s.cyberduckreceipt", receipt.getName()))); } catch(AccessDeniedException e) { log.warn(e.getMessage()); } return receipt; } else { log.error(String.format("Invalid receipt found in %s", file)); System.exit(APPSTORE_VALIDATION_FAILURE); return null; } }
ReceiptFactory extends LicenseFactory { @Override protected License open(final Local file) { final ReceiptVerifier verifier = new ReceiptVerifier(file); if(verifier.verify(new DisabledLicenseVerifierCallback())) { final Receipt receipt = new Receipt(file, verifier.getGuid()); if(log.isInfoEnabled()) { log.info(String.format("Valid receipt %s in %s", receipt, file)); } final Local support = SupportDirectoryFinderFactory.get().find(); try { file.copy(LocalFactory.get(support, String.format("%s.cyberduckreceipt", receipt.getName()))); } catch(AccessDeniedException e) { log.warn(e.getMessage()); } return receipt; } else { log.error(String.format("Invalid receipt found in %s", file)); System.exit(APPSTORE_VALIDATION_FAILURE); return null; } } }
ReceiptFactory extends LicenseFactory { @Override protected License open(final Local file) { final ReceiptVerifier verifier = new ReceiptVerifier(file); if(verifier.verify(new DisabledLicenseVerifierCallback())) { final Receipt receipt = new Receipt(file, verifier.getGuid()); if(log.isInfoEnabled()) { log.info(String.format("Valid receipt %s in %s", receipt, file)); } final Local support = SupportDirectoryFinderFactory.get().find(); try { file.copy(LocalFactory.get(support, String.format("%s.cyberduckreceipt", receipt.getName()))); } catch(AccessDeniedException e) { log.warn(e.getMessage()); } return receipt; } else { log.error(String.format("Invalid receipt found in %s", file)); System.exit(APPSTORE_VALIDATION_FAILURE); return null; } } ReceiptFactory();  ReceiptFactory(final Local folder); }
ReceiptFactory extends LicenseFactory { @Override protected License open(final Local file) { final ReceiptVerifier verifier = new ReceiptVerifier(file); if(verifier.verify(new DisabledLicenseVerifierCallback())) { final Receipt receipt = new Receipt(file, verifier.getGuid()); if(log.isInfoEnabled()) { log.info(String.format("Valid receipt %s in %s", receipt, file)); } final Local support = SupportDirectoryFinderFactory.get().find(); try { file.copy(LocalFactory.get(support, String.format("%s.cyberduckreceipt", receipt.getName()))); } catch(AccessDeniedException e) { log.warn(e.getMessage()); } return receipt; } else { log.error(String.format("Invalid receipt found in %s", file)); System.exit(APPSTORE_VALIDATION_FAILURE); return null; } } ReceiptFactory();  ReceiptFactory(final Local folder); @Override List<License> open(); }
ReceiptFactory extends LicenseFactory { @Override protected License open(final Local file) { final ReceiptVerifier verifier = new ReceiptVerifier(file); if(verifier.verify(new DisabledLicenseVerifierCallback())) { final Receipt receipt = new Receipt(file, verifier.getGuid()); if(log.isInfoEnabled()) { log.info(String.format("Valid receipt %s in %s", receipt, file)); } final Local support = SupportDirectoryFinderFactory.get().find(); try { file.copy(LocalFactory.get(support, String.format("%s.cyberduckreceipt", receipt.getName()))); } catch(AccessDeniedException e) { log.warn(e.getMessage()); } return receipt; } else { log.error(String.format("Invalid receipt found in %s", file)); System.exit(APPSTORE_VALIDATION_FAILURE); return null; } } ReceiptFactory();  ReceiptFactory(final Local folder); @Override List<License> open();  }