/** * @return List of enabled protocols */ public List<Protocol> find() { return this.find(Protocol::isEnabled); }
/** * @param identifier Serialized protocol reference or scheme * @param provider Custom inherited protocol definition * @return Matching protocol or null if no match */ public Protocol forName(final String identifier, final String provider) { return this.forName(this.find(), identifier, provider); }
public Protocol forType(final Protocol.Type type) { final List<Protocol> enabled = this.find(); return this.forType(enabled, type); }
public Protocol forScheme(final String scheme, final Protocol fallback) { return this.forScheme(this.find(), scheme, fallback); }
public Profile deserialize(Object serialized) { final Deserializer<String> dict = deserializer.create(serialized); final String protocol = dict.stringForKey("Protocol"); if(StringUtils.isNotBlank(protocol)) { final Protocol parent = protocols.forName(protocols.find(new Predicate<Protocol>() { @Override public boolean test(final Protocol protocol) { // Return default registered protocol specification as parent but not other profile return !(protocol.isEnabled() || protocol.isBundled()); } }), protocol, null); if(null == parent) { log.error(String.format("Unknown protocol %s in profile", protocol)); return null; } return new Profile(parent, dict); } log.error("Missing protocol in profile"); return null; } }
for(Protocol p : protocols.find(new DefaultProtocolPredicate(EnumSet.of(Protocol.Type.ftp, Protocol.Type.sftp, Protocol.Type.dav)))) { append(p, builder); for(Protocol p : protocols.find(new DefaultProtocolPredicate(EnumSet.of(Protocol.Type.s3, Protocol.Type.swift, Protocol.Type.azure, Protocol.Type.b2, Protocol.Type.googlestorage)))) { append(p, builder); for(Protocol p : protocols.find(new DefaultProtocolPredicate( EnumSet.of(Protocol.Type.dropbox, Protocol.Type.onedrive, Protocol.Type.googledrive, Protocol.Type.dracoon)))) { append(p, builder); for(Protocol p : protocols.find(new DefaultProtocolPredicate(EnumSet.of(Protocol.Type.file)))) { append(p, builder); PreferencesFactory.get().getProperty("profiles.folder.name")).getAbbreviatedPath())); builder.append(StringUtils.LF); for(Protocol p : protocols.find(new ProfileProtocolPredicate())) { append(p, builder);
this.protocolCombobox.removeAllItems(); final ProtocolFactory protocols = ProtocolFactory.get(); for(Protocol protocol : protocols.find(new DefaultProtocolPredicate( EnumSet.of(Protocol.Type.ftp, Protocol.Type.sftp, Protocol.Type.dav)))) { this.addProtocol(protocol); for(Protocol protocol : protocols.find(new DefaultProtocolPredicate( EnumSet.of(Protocol.Type.s3, Protocol.Type.swift, Protocol.Type.azure, Protocol.Type.b2, Protocol.Type.dracoon, Protocol.Type.googlestorage)))) { this.addProtocol(protocol); for(Protocol protocol : protocols.find(new DefaultProtocolPredicate( EnumSet.of(Protocol.Type.dropbox, Protocol.Type.onedrive, Protocol.Type.googledrive)))) { this.addProtocol(protocol); for(Protocol protocol : protocols.find(new DefaultProtocolPredicate( EnumSet.of(Protocol.Type.file)))) { this.addProtocol(protocol); for(Protocol protocol : protocols.find(new ProfileProtocolPredicate())) { this.addProtocol(protocol);
this.protocolPopup.setAction(Foundation.selector("protocolSelectionChanged:")); this.protocolPopup.removeAllItems(); for(Protocol protocol : protocols.find(new DefaultProtocolPredicate( EnumSet.of(Protocol.Type.ftp, Protocol.Type.sftp, Protocol.Type.dav)))) { this.addProtocol(protocol); for(Protocol protocol : protocols.find(new DefaultProtocolPredicate( EnumSet.of(Protocol.Type.s3, Protocol.Type.swift, Protocol.Type.azure, Protocol.Type.b2, Protocol.Type.dracoon, Protocol.Type.googlestorage)))) { this.addProtocol(protocol); for(Protocol protocol : protocols.find(new DefaultProtocolPredicate( EnumSet.of(Protocol.Type.dropbox, Protocol.Type.onedrive, Protocol.Type.googledrive)))) { this.addProtocol(protocol); for(Protocol protocol : protocols.find(new DefaultProtocolPredicate( EnumSet.of(Protocol.Type.file)))) { this.addProtocol(protocol); for(Protocol protocol : protocols.find(new ProfileProtocolPredicate())) { this.addProtocol(protocol);