Skip to content

Commit 75af26c

Browse files
committed
Extract variable.
1 parent 5a5a2cc commit 75af26c

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

hub/src/main/java/cloud/katta/protocols/hub/HubSession.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,20 @@
44

55
package cloud.katta.protocols.hub;
66

7-
import ch.cyberduck.core.*;
7+
import ch.cyberduck.core.Credentials;
8+
import ch.cyberduck.core.DisabledListProgressListener;
9+
import ch.cyberduck.core.Host;
10+
import ch.cyberduck.core.HostKeyCallback;
11+
import ch.cyberduck.core.HostPasswordStore;
12+
import ch.cyberduck.core.ListService;
13+
import ch.cyberduck.core.LocaleFactory;
14+
import ch.cyberduck.core.LoginCallback;
15+
import ch.cyberduck.core.OAuthTokens;
16+
import ch.cyberduck.core.PasswordStoreFactory;
17+
import ch.cyberduck.core.Profile;
18+
import ch.cyberduck.core.Protocol;
19+
import ch.cyberduck.core.ProtocolFactory;
20+
import ch.cyberduck.core.Session;
821
import ch.cyberduck.core.exception.BackgroundException;
922
import ch.cyberduck.core.exception.ConnectionCanceledException;
1023
import ch.cyberduck.core.exception.InteroperabilityException;
@@ -85,7 +98,8 @@ public HubVaultRegistry getRegistry() {
8598
protected HubApiClient connect(final ProxyFinder proxy, final HostKeyCallback key,
8699
final LoginCallback prompt, final CancelCallback cancel) throws BackgroundException {
87100
final HttpClientBuilder configuration = builder.build(proxy, this, prompt);
88-
if(host.getProtocol().isBundled()) {
101+
final Protocol bundled = host.getProtocol();
102+
if(bundled.isBundled()) {
89103
// Use REST API for bootstrapping via /api/config
90104
final HubApiClient client = new HubApiClient(host, configuration.build());
91105
try {
@@ -103,7 +117,7 @@ protected HubApiClient connect(final ProxyFinder proxy, final HostKeyCallback ke
103117
final String hubId = configDto.getUuid();
104118
log.debug("Configure bookmark with id {}", hubId);
105119
host.setUuid(hubId);
106-
final Profile profile = new Profile(host.getProtocol(), new HubConfigDtoDeserializer(configDto));
120+
final Profile profile = new Profile(bundled, new HubConfigDtoDeserializer(configDto));
107121
log.debug("Apply profile {} to bookmark {}", profile, host);
108122
host.setProtocol(profile);
109123
}

0 commit comments

Comments
 (0)