protected static String toScheme(final String redirectUri) {
        return StringUtils.substringBefore(URIEncoder.decode(redirectUri), ':');
    }
@Test
    public void toScheme() {
        assertEquals("x-cyberduck-action", CustomSchemeHandlerOAuth2AuthorizationCodeProvider.toScheme("x-cyberduck-action:oauth"));
        assertEquals("https", CustomSchemeHandlerOAuth2AuthorizationCodeProvider.toScheme("https://redirect/"));
    }