@Test public void testScheme() throws Exception { final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new AzureProtocol()))); final ProfilePlistReader reader = new ProfilePlistReader(factory, new DeserializerFactory()); final Profile profile = reader.read( this.getClass().getResourceAsStream("/Azure.cyberduckprofile") ); assertEquals("azure", TerminalHelpPrinter.getScheme(profile)); }
protected static String getScheme(final Protocol protocol) { if(new BundledProtocolPredicate().test(protocol)) { for(String scheme : protocol.getSchemes()) { return scheme; } return protocol.getIdentifier(); } final Protocol standard = ProtocolFactory.get().forName(protocol.getIdentifier()); if(Arrays.equals(protocol.getSchemes(), standard.getSchemes())) { return protocol.getProvider(); } for(String scheme : protocol.getSchemes()) { return scheme; } return protocol.getProvider(); }
TerminalHelpPrinter { protected static String getScheme(final Protocol protocol) { if(new BundledProtocolPredicate().test(protocol)) { for(String scheme : protocol.getSchemes()) { return scheme; } return protocol.getIdentifier(); } final Protocol standard = ProtocolFactory.get().forName(protocol.getIdentifier()); if(Arrays.equals(protocol.getSchemes(), standard.getSchemes())) { return protocol.getProvider(); } for(String scheme : protocol.getSchemes()) { return scheme; } return protocol.getProvider(); } }
TerminalHelpPrinter { protected static String getScheme(final Protocol protocol) { if(new BundledProtocolPredicate().test(protocol)) { for(String scheme : protocol.getSchemes()) { return scheme; } return protocol.getIdentifier(); } final Protocol standard = ProtocolFactory.get().forName(protocol.getIdentifier()); if(Arrays.equals(protocol.getSchemes(), standard.getSchemes())) { return protocol.getProvider(); } for(String scheme : protocol.getSchemes()) { return scheme; } return protocol.getProvider(); } private  TerminalHelpPrinter(); }
TerminalHelpPrinter { protected static String getScheme(final Protocol protocol) { if(new BundledProtocolPredicate().test(protocol)) { for(String scheme : protocol.getSchemes()) { return scheme; } return protocol.getIdentifier(); } final Protocol standard = ProtocolFactory.get().forName(protocol.getIdentifier()); if(Arrays.equals(protocol.getSchemes(), standard.getSchemes())) { return protocol.getProvider(); } for(String scheme : protocol.getSchemes()) { return scheme; } return protocol.getProvider(); } private  TerminalHelpPrinter(); static void print(final Options options); static void print(final Options options, final HelpFormatter formatter); }
TerminalHelpPrinter { protected static String getScheme(final Protocol protocol) { if(new BundledProtocolPredicate().test(protocol)) { for(String scheme : protocol.getSchemes()) { return scheme; } return protocol.getIdentifier(); } final Protocol standard = ProtocolFactory.get().forName(protocol.getIdentifier()); if(Arrays.equals(protocol.getSchemes(), standard.getSchemes())) { return protocol.getProvider(); } for(String scheme : protocol.getSchemes()) { return scheme; } return protocol.getProvider(); } private  TerminalHelpPrinter(); static void print(final Options options); static void print(final Options options, final HelpFormatter formatter);  }