public NetworkInterfaceAwareSocketFactory(final SocketFactory delegate, final java.net.Proxy proxy) { this(delegate, PreferencesFactory.get().getList("network.interface.blacklist"), proxy); }
public NetworkInterfaceAwareSocketFactory(final SocketFactory delegate) { this(delegate, PreferencesFactory.get().getList("network.interface.blacklist"), null); }
public BundleRegexLocale() { final List<String> languages = PreferencesFactory.get().getList("AppleLanguages"); if(!languages.isEmpty()) { try { fallback.setDefault( LocaleUtils.toLocale(StringUtils.replace(languages.iterator().next(), "-", "_")).getLanguage()); } catch(IllegalArgumentException e) { log.warn(String.format("Failure to parse default language set. %s", e.getMessage())); } } }
public Map<String, String> getMap(final String property) { final List<String> list = this.getList(property); final Map<String, String> table = new HashMap<String, String>(); for(String m : list) { if(StringUtils.isBlank(m)) { continue; } if(!m.contains("=")) { log.warn(String.format("Invalid header %s", m)); continue; } int split = m.indexOf('='); String key = m.substring(0, split); if(StringUtils.isBlank(key)) { log.warn(String.format("Missing key in %s", m)); continue; } String value = m.substring(split + 1); if(StringUtils.isEmpty(value)) { log.warn(String.format("Missing value in %s", m)); continue; } table.put(key, value); } return table; }
final List<String> blacklist = preferences.getList("connection.ssl.cipher.blacklist"); if(!blacklist.isEmpty()) { ciphers.removeIf(blacklist::contains);
@Override public boolean alert(final ConnectionCallback prompt) throws BackgroundException { if(null == algorithms) { return super.alert(prompt); } if(!preferences.getBoolean(String.format("ssh.algorithm.whitelist.%s", host.getHostname()))) { if(preferences.getList("ssh.algorithm.cipher.blacklist").contains(algorithms.getClient2ServerCipherAlgorithm())) { alert(prompt, algorithms.getClient2ServerCipherAlgorithm()); } if(preferences.getList("ssh.algorithm.cipher.blacklist").contains(algorithms.getServer2ClientCipherAlgorithm())) { alert(prompt, algorithms.getServer2ClientCipherAlgorithm()); } if(preferences.getList("ssh.algorithm.mac.blacklist").contains(algorithms.getClient2ServerMACAlgorithm())) { alert(prompt, algorithms.getClient2ServerMACAlgorithm()); } if(preferences.getList("ssh.algorithm.mac.blacklist").contains(algorithms.getServer2ClientMACAlgorithm())) { alert(prompt, algorithms.getServer2ClientMACAlgorithm()); } if(preferences.getList("ssh.algorithm.kex.blacklist").contains(algorithms.getKeyExchangeAlgorithm())) { alert(prompt, algorithms.getKeyExchangeAlgorithm()); } if(preferences.getList("ssh.algorithm.signature.blacklist").contains(algorithms.getSignatureAlgorithm())) { alert(prompt, algorithms.getSignatureAlgorithm()); } } return super.alert(prompt); }
public void setLifecycleDeletePopup(final NSPopUpButton b) { this.lifecycleDeletePopup = b; for(String option : preferences.getList("s3.lifecycle.delete.options")) { this.lifecycleDeletePopup.addItemWithTitle(MessageFormat.format(LocaleFactory.localizedString("after {0} Days", "S3"), option)); this.lifecycleDeletePopup.lastItem().setAction(Foundation.selector("lifecyclePopupClicked:")); this.lifecycleDeletePopup.lastItem().setTarget(this.id()); this.lifecycleDeletePopup.lastItem().setRepresentedObject(option); } }
public void setLifecycleTransitionPopup(final NSPopUpButton b) { this.lifecycleTransitionPopup = b; this.lifecycleTransitionPopup.setTarget(this.id()); for(String option : preferences.getList("s3.lifecycle.transition.options")) { this.lifecycleTransitionPopup.addItemWithTitle(MessageFormat.format(LocaleFactory.localizedString("after {0} Days", "S3"), option)); this.lifecycleTransitionPopup.lastItem().setAction(Foundation.selector("lifecyclePopupClicked:")); this.lifecycleTransitionPopup.lastItem().setTarget(this.id()); this.lifecycleTransitionPopup.lastItem().setRepresentedObject(option); } }
if(transferObj != null) { final Host.TransferType transfer = Host.TransferType.valueOf(transferObj.toString()); if(PreferencesFactory.get().getList("queue.transfer.type.enabled").contains(transfer.name())) { bookmark.setTransfer(transfer);
public void setTransferPopup(NSPopUpButton b) { this.transferPopup = b; this.transferPopup.setTarget(this.id()); this.transferPopup.setAction(Foundation.selector("transferPopupClicked:")); this.transferPopup.removeAllItems(); for(String name : preferences.getList("queue.transfer.type.enabled")) { final Host.TransferType t = Host.TransferType.valueOf(name); this.transferPopup.addItemWithTitle(t.toString()); this.transferPopup.lastItem().setRepresentedObject(t.name()); } this.transferPopup.selectItemAtIndex(this.transferPopup.indexOfItemWithRepresentedObject( preferences.getProperty("queue.transfer.type") )); }
public void setTransferPopup(final NSPopUpButton button) { this.transferPopup = button; this.transferPopup.setTarget(this.id()); this.transferPopup.setAction(Foundation.selector("transferPopupClicked:")); this.transferPopup.removeAllItems(); final Host.TransferType unknown = Host.TransferType.unknown; this.transferPopup.addItemWithTitle(unknown.toString()); this.transferPopup.lastItem().setRepresentedObject(unknown.name()); this.transferPopup.menu().addItem(NSMenuItem.separatorItem()); for(String name : preferences.getList("queue.transfer.type.enabled")) { final Host.TransferType t = Host.TransferType.valueOf(name); this.transferPopup.addItemWithTitle(t.toString()); this.transferPopup.lastItem().setRepresentedObject(t.name()); } this.addObserver(new BookmarkObserver() { @Override public void change(Host bookmark) { transferPopup.selectItemAtIndex(transferPopup.indexOfItemWithRepresentedObject(bookmark.getTransferType().name())); } }); }