Skip to content

Commit 0471297

Browse files
author
bartek.zylinski
committed
SDK-5186: Mark class and constructors as deprecated
1 parent 6aadb6d commit 0471297

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
<img src="https://github.com/box/sdks/blob/master/images/box-dev-logo.png" alt= “box-dev-logo” width="30%" height="50%">
33
</p>
44

5+
# Deprecation notice
6+
7+
This version of the Box Java SDK is under maintenance mode, and will be deprecated soon, only critical security updates and bug fixes will be provided. We recommend using the new version Box Java SDK, which can be found at [box/box-java-sdk-gen](https://github.com/box/box-java-sdk-gen)
8+
9+
You can find the migration guide [here](https://github.com/box/box-java-sdk-gen/blob/main/migration-guide.md) for transitioning from Box Java SDK v3.x to the new `box-sdk-gen` package. If you have any questions, please create an issue in the new repository or reach out to [Box Developer Support](https://developer.box.com/support/).
10+
511
# Migration to v10
612

713
The [sdk-gen](https://github.com/box/box-java-sdk/tree/sdk-gen) branch contains the generated code for the `v10` version of the Box Java SDK. This is intended primarily for developers migrating from [Box Java SDK Gen](https://github.com/box/box-java-sdk-gen) to the v10 version.
@@ -11,7 +17,7 @@ You can find the migration guide [here](https://github.com/box/box-java-sdk/blob
1117

1218
# Box Java SDK
1319

14-
[![Project Status](http://opensource.box.com/badges/active.svg)](http://opensource.box.com/badges)
20+
[![Project Status](http://opensource.box.com/badges/stable.svg)](http://opensource.box.com/badges)
1521
![Platform](https://img.shields.io/badge/java-%3E%3D8-blue)
1622
[![License](https://img.shields.io/badge/license-Apache2-blue)](https://raw.githubusercontent.com/box/box-java-sdk/main/LICENSE)
1723
[![Build main](https://github.com/box/box-java-sdk/actions/workflows/build-main.yml/badge.svg)](https://github.com/box/box-java-sdk/actions/workflows/build-main.yml)

src/main/java/com/box/sdk/BoxAPIConnection.java

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,17 @@
3737
import okhttp3.Response;
3838

3939
/**
40+
* @deprecated
41+
* This class, and the com.box.sdk package is deprecated, it is recommended to use com.box.sdkgen package.
42+
*
4043
* Represents an authenticated connection to the Box API.
4144
*
4245
* <p>This class handles storing authentication information, automatic token refresh, and
4346
* rate-limiting. It can also be used to configure the Box API endpoint URL in order to hit a
4447
* different version of the API. Multiple instances of BoxAPIConnection may be created to support
4548
* multi-user login.
4649
*/
50+
@Deprecated
4751
public class BoxAPIConnection {
4852

4953
/**
@@ -136,22 +140,30 @@ public class BoxAPIConnection {
136140
private Authenticator authenticator;
137141

138142
/**
143+
* @deprecated
144+
* This constructor, and the com.box.sdk package is deprecated, it is recommended to use com.box.sdkgen package.
145+
*
139146
* Constructs a new BoxAPIConnection that authenticates with a developer or access token.
140147
*
141148
* @param accessToken a developer or access token to use for authenticating with the API.
142149
*/
150+
@Deprecated
143151
public BoxAPIConnection(String accessToken) {
144152
this(null, null, accessToken, null);
145153
}
146154

147155
/**
156+
* @deprecated
157+
* This constructor, and the com.box.sdk package is deprecated, it is recommended to use com.box.sdkgen package.
158+
*
148159
* Constructs a new BoxAPIConnection with an access token that can be refreshed.
149160
*
150161
* @param clientID the client ID to use when refreshing the access token.
151162
* @param clientSecret the client secret to use when refreshing the access token.
152163
* @param accessToken an initial access token to use for authenticating with the API.
153164
* @param refreshToken an initial refresh token to use when refreshing the access token.
154165
*/
166+
@Deprecated
155167
public BoxAPIConnection(
156168
String clientID, String clientSecret, String accessToken, String refreshToken) {
157169
this.clientID = clientID;
@@ -171,38 +183,50 @@ public BoxAPIConnection(
171183
this.userAgent = "Box Java SDK v" + SDK_VERSION + " (Java " + JAVA_VERSION + ")";
172184
this.listeners = new ArrayList<>();
173185
this.customHeaders = new HashMap<>();
174-
186+
System.err.println("Package boxsdk will be deprecated soon. Please use box-sdk-gen instead.");
175187
buildHttpClients();
176188
}
177189

178190
/**
191+
* @deprecated
192+
* This constructor, and the com.box.sdk package is deprecated, it is recommended to use com.box.sdkgen package.
193+
*
179194
* Constructs a new BoxAPIConnection with an auth code that was obtained from the first half of
180195
* OAuth.
181196
*
182197
* @param clientID the client ID to use when exchanging the auth code for an access token.
183198
* @param clientSecret the client secret to use when exchanging the auth code for an access token.
184199
* @param authCode an auth code obtained from the first half of the OAuth process.
185200
*/
201+
@Deprecated
186202
public BoxAPIConnection(String clientID, String clientSecret, String authCode) {
187203
this(clientID, clientSecret, null, null);
188204
this.authenticate(authCode);
189205
}
190206

191207
/**
208+
* @deprecated
209+
* This constructor, and the com.box.sdk package is deprecated, it is recommended to use com.box.sdkgen package.
210+
*
192211
* Constructs a new BoxAPIConnection.
193212
*
194213
* @param clientID the client ID to use when exchanging the auth code for an access token.
195214
* @param clientSecret the client secret to use when exchanging the auth code for an access token.
196215
*/
216+
@Deprecated
197217
public BoxAPIConnection(String clientID, String clientSecret) {
198218
this(clientID, clientSecret, null, null);
199219
}
200220

201221
/**
202-
* Constructs a new BoxAPIConnection levaraging BoxConfig.
222+
* @deprecated
223+
* This constructor, and the com.box.sdk package is deprecated, it is recommended to use com.box.sdkgen package.
224+
*
225+
* Constructs a new BoxAPIConnection leveraging BoxConfig.
203226
*
204227
* @param boxConfig BoxConfig file, which should have clientId and clientSecret
205228
*/
229+
@Deprecated
206230
public BoxAPIConnection(BoxConfig boxConfig) {
207231
this(boxConfig.getClientId(), boxConfig.getClientSecret(), null, null);
208232
}

0 commit comments

Comments
 (0)