@Test public void testSetDefaultHandlerForURLScheme() { final SchemeHandler l = new LaunchServicesSchemeHandler(new LaunchServicesApplicationFinder()); l.setDefaultHandler( new Application("none.app", null), Collections.singletonList(Scheme.ftp.name()) ); assertEquals(Application.notfound, l.getDefaultHandler(Scheme.ftp.name())); assertFalse(l.isDefaultHandler(Collections.singletonList(Scheme.ftp.name()), new Application("other.app", null))); l.setDefaultHandler( new Application("ch.sudo.cyberduck", null), Collections.singletonList(Scheme.ftp.name()) ); assertEquals("ch.sudo.cyberduck", l.getDefaultHandler(Scheme.ftp.name()).getIdentifier()); assertNotSame("ch.sudo.cyberduck", l.getDefaultHandler(Scheme.http.name()).getIdentifier()); assertTrue(l.isDefaultHandler(Collections.singletonList(Scheme.ftp.name()), new Application("ch.sudo.cyberduck", null))); }
private native void setDefaultHandlerForURLScheme(String scheme, String bundleIdentifier);
LaunchServicesSchemeHandler extends AbstractSchemeHandler { private native void setDefaultHandlerForURLScheme(String scheme, String bundleIdentifier); }
LaunchServicesSchemeHandler extends AbstractSchemeHandler { private native void setDefaultHandlerForURLScheme(String scheme, String bundleIdentifier); LaunchServicesSchemeHandler();  LaunchServicesSchemeHandler(final ApplicationFinder applicationFinder); }
LaunchServicesSchemeHandler extends AbstractSchemeHandler { private native void setDefaultHandlerForURLScheme(String scheme, String bundleIdentifier); LaunchServicesSchemeHandler();  LaunchServicesSchemeHandler(final ApplicationFinder applicationFinder); @Override void setDefaultHandler(final Application application, final List<String> schemes); @Override Application getDefaultHandler(final String scheme); @Override List<Application> getAllHandlers(final String scheme); }
LaunchServicesSchemeHandler extends AbstractSchemeHandler { private native void setDefaultHandlerForURLScheme(String scheme, String bundleIdentifier); LaunchServicesSchemeHandler();  LaunchServicesSchemeHandler(final ApplicationFinder applicationFinder); @Override void setDefaultHandler(final Application application, final List<String> schemes); @Override Application getDefaultHandler(final String scheme); @Override List<Application> getAllHandlers(final String scheme);  }