Skip to content

Commit

Permalink
feat: allow to modify the underlying okHttpClient from the BoxApiConn…
Browse files Browse the repository at this point in the history
…ection subclasses

Refs: #1271
  • Loading branch information
davigotxi committed Nov 11, 2024
1 parent 6ea70f7 commit 3bb5be5
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/box/sdk/BoxCCGAPIConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ private BoxCCGAPIConnection(BoxConfig boxConfig) {
super(boxConfig);
}

/**
* {@inheritDoc}
*/
@Override
protected OkHttpClient.Builder modifyHttpClientBuilder(OkHttpClient.Builder httpClientBuilder) {
return super.modifyHttpClientBuilder(httpClientBuilder);
}

/**
* Creates connection that authenticates as a Service Account
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ public BoxDeveloperEditionAPIConnection(String entityId, DeveloperEditionEntityT
boxConfig.getJWTEncryptionPreferences(), accessTokenCache);
}

/**
* {@inheritDoc}
*/
@Override
protected OkHttpClient.Builder modifyHttpClientBuilder(OkHttpClient.Builder httpClientBuilder) {
return super.modifyHttpClientBuilder(httpClientBuilder);
}

/**
* Creates a new Box Developer Edition connection with enterprise token leveraging an access token cache.
*
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/box/sdk/BoxTransactionalAPIConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ public BoxTransactionalAPIConnection(String accessToken) {
super.setAutoRefresh(false);
}

/**
* {@inheritDoc}
*/
@Override
protected OkHttpClient.Builder modifyHttpClientBuilder(OkHttpClient.Builder httpClientBuilder) {
return super.modifyHttpClientBuilder(httpClientBuilder);
}

/**
* Request a scoped transactional token.
*
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/box/sdk/SharedLinkAPIConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ public SharedLinkAPIConnection(BoxAPIConnection connection, String sharedLink, S
this.sharedLinkPassword = sharedLinkPassword;
}

/**
* {@inheritDoc}
*/
@Override
protected OkHttpClient.Builder modifyHttpClientBuilder(OkHttpClient.Builder httpClientBuilder) {
return super.modifyHttpClientBuilder(httpClientBuilder);
}

@Override
public long getExpires() {
return this.wrappedConnection.getExpires();
Expand Down

0 comments on commit 3bb5be5

Please sign in to comment.