Skip to content

Commit 2c0bf92

Browse files
committed
Cleaned up how the authority for the new Ds3Client is created in the helper function.
1 parent 7b6004c commit 2c0bf92

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

ds3-sdk/src/main/java/com/spectralogic/ds3client/ConnectionDetailsImpl.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static ConnectionDetails newForNode(final Node node, final ConnectionDeta
8282
}
8383
else {
8484
LOG.trace("Creating new Connection Details for endpoint: " + node.getEndpoint());
85-
connectionBuilder = builder(node.getEndpoint() + ":" + getPort(node, connectionDetails), connectionDetails.getCredentials());
85+
connectionBuilder = builder(buildAuthority(node, connectionDetails), connectionDetails.getCredentials());
8686
}
8787
connectionBuilder.withRedirectRetries(connectionDetails.getRetries())
8888
.withHttps(connectionDetails.isHttps())
@@ -93,13 +93,9 @@ public static ConnectionDetails newForNode(final Node node, final ConnectionDeta
9393
return connectionBuilder.build();
9494
}
9595

96-
private static String getPort(final Node node, final ConnectionDetails connectionDetails) {
97-
if (connectionDetails.isHttps()) {
98-
return Integer.toString(node.getHttpsPort());
99-
}
100-
else {
101-
return Integer.toString(node.getHttpPort());
102-
}
96+
private static String buildAuthority(final Node node, final ConnectionDetails connectionDetails) {
97+
return node.getEndpoint() + ":" + Integer.toString(
98+
(connectionDetails.isHttps() ? node.getHttpsPort() : node.getHttpPort()));
10399
}
104100

105101
private final String endpoint;

0 commit comments

Comments
 (0)