@Override public String help(final Scheme scheme) { return this.help(scheme.name()); } }
@Override public String getIdentifier() { return this.getScheme().name(); }
@Override public String getPassword(final Scheme scheme, final int port, final String hostname, final String user) { return this.getInternetPasswordFromKeychain(scheme.name(), port, hostname, user); }
@Override public String getIdentifier() { return this.getScheme().name(); }
@Override public String getIdentifier() { return this.getScheme().name(); }
@Override public String getIdentifier() { return this.getScheme().name(); }
@Override public String getIdentifier() { return this.getScheme().name(); }
@Override public void addPassword(final Scheme scheme, final int port, final String hostname, final String user, final String password) { this.addInternetPasswordToKeychain(scheme.name(), port, hostname, user, password); }
@Override public String getName() { return this.getScheme().name().toUpperCase(Locale.ROOT); }
public Protocol forScheme(final Scheme scheme) { return this.forScheme(scheme.name(), null); }
@Override public String[] getSchemes() { final HashSet<String> schemes = new LinkedHashSet<>(Arrays.asList(this.getIdentifier(), this.getScheme().name())); return schemes.toArray(new String[schemes.size()]); }
/** * See ApplicationServices/ApplicationServices.h#LSSetDefaultHandlerForURLScheme * Register this bundle identifier as the default application for all schemes * * @param application The bundle identifier of the application * @param scheme The protocol identifier */ @Override public void setDefaultHandlerForScheme(final Application application, final Scheme scheme) { this.setDefaultHandler(scheme.name(), application.getIdentifier()); }
@Override public List<Application> getAllHandlers(final Scheme scheme) { final List<Application> handlers = new ArrayList<Application>(); for(String bundleIdentifier : this.getAllHandlers(scheme.name())) { final Application application = applicationFinder.getDescription(bundleIdentifier); if(applicationFinder.isInstalled(application)) { handlers.add(application); } } return handlers; }
private native String getDefaultHandler(String scheme);
@Override public DescriptiveUrlBag toUrl(final Path file) { if(file.isVolume()) { return DescriptiveUrlBag.empty(); } final DescriptiveUrlBag list = new DescriptiveUrlBag(); if(file.isFile()) { final String download = String.format("%s/file/%s/%s", session.getClient().getDownloadUrl(), URIEncoder.encode(containerService.getContainer(file).getName()), URIEncoder.encode(containerService.getKey(file))); list.add(new DescriptiveUrl(URI.create(download), DescriptiveUrl.Type.http, MessageFormat.format(LocaleFactory.localizedString("{0} URL"), Scheme.https.name().toUpperCase(Locale.ROOT)))); } return list; } }
@Override public HttpClientBuilder build(final Proxy proxy, final TranscriptListener listener, final LoginCallback prompt) { final HttpClientBuilder builder = super.build(proxy, listener, prompt); // Add filter to inject custom headers to authenticate with proxy builder.setRequestExecutor( new CustomHeaderHttpRequestExecutor(headers) ); // Set proxy router planer builder.setRoutePlanner(new DefaultProxyRoutePlanner( new HttpHost(this.proxy.getHostname(), this.proxy.getPort(), this.proxy.getProtocol().getScheme().name()), new DefaultSchemePortResolver())); return builder; }
public void setTextField(NSTextField textField) { this.textField = textField; this.textField.setSelectable(true); if(StringUtils.startsWith(reason, Scheme.http.name())) { // For OAuth2 this.textField.setAttributedStringValue(HyperlinkAttributedStringFactory.create(reason)); this.textField.setAllowsEditingTextAttributes(true); this.textField.setSelectable(true); } else { this.updateField(this.textField, new StringAppender().append(reason).toString()); } } }
public MantaSession(final Host host, final X509TrustManager trust, final X509KeyManager key) { super(host, new ThreadLocalHostnameDelegatingTrustManager(new DisabledX509TrustManager(), host.getHostname()), key); config = new AuthAwareConfigContext(new ChainedConfigContext( new DefaultsConfigContext(), new StandardConfigContext() .setNoAuth(true) .setMantaKeyPath(null) .setHttpsProtocols(PreferencesFactory.get().getProperty("connection.ssl.protocols")) .setDisableNativeSignatures(true) .setMantaUser(host.getCredentials().getUsername()) .setMantaURL(String.format("%s://%s", host.getProtocol().getScheme().name(), host.getHostname())) )); }