Skip to content

Commit 83930b3

Browse files
committed
drop deprecated methods
1 parent 13d67a7 commit 83930b3

7 files changed

Lines changed: 1 addition & 229 deletions

File tree

scribejava-core/src/main/java/com/github/scribejava/core/builder/ServiceBuilder.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,6 @@ public ServiceBuilder readTimeout(Integer readTimeout) {
135135
return this;
136136
}
137137

138-
/**
139-
* throws UnsupportedOperationException
140-
*
141-
* @param httpClientConfig httpClientConfig
142-
* @return never
143-
* @deprecated use {@link #httpClientConfig(com.github.scribejava.core.httpclient.HttpClientConfig)}
144-
*/
145-
@Deprecated
146-
public ServiceBuilder httpClientConfig(com.github.scribejava.core.model.HttpClient.Config httpClientConfig) {
147-
throw new UnsupportedOperationException("deprecated, use another method, see javadocs");
148-
}
149-
150138
public ServiceBuilder httpClientConfig(HttpClientConfig httpClientConfig) {
151139
Preconditions.checkNotNull(httpClientConfig, "httpClientConfig can't be null");
152140
this.httpClientConfig = httpClientConfig;

scribejava-core/src/main/java/com/github/scribejava/core/model/AbstractRequest.java

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import java.util.HashMap;
88
import java.util.Map;
99
import com.github.scribejava.core.exceptions.OAuthException;
10-
import com.github.scribejava.core.oauth.OAuthService;
1110
import java.io.File;
1211

1312
/**
@@ -37,19 +36,6 @@ public abstract class AbstractRequest {
3736

3837
private String realm;
3938

40-
/**
41-
* Default constructor.
42-
*
43-
* @param verb Http verb/method
44-
* @param url resource URL
45-
* @param service OAuthService
46-
* @deprecated use {@link #AbstractRequest(com.github.scribejava.core.model.Verb, java.lang.String)}
47-
*/
48-
@Deprecated
49-
public AbstractRequest(Verb verb, String url, OAuthService<?> service) {
50-
this(verb, url);
51-
}
52-
5339
/**
5440
* Default constructor.
5541
*
@@ -145,24 +131,6 @@ protected boolean hasBodyContent() {
145131
return verb == Verb.PUT || verb == Verb.POST;
146132
}
147133

148-
/**
149-
* @param payload payload
150-
* @deprecated use {@link #setPayload(java.lang.String) }
151-
*/
152-
@Deprecated
153-
public void addPayload(String payload) {
154-
setPayload(payload);
155-
}
156-
157-
/**
158-
* @param payload payload
159-
* @deprecated use {@link #setPayload(byte[]) }
160-
*/
161-
@Deprecated
162-
public void addPayload(byte[] payload) {
163-
setPayload(payload);
164-
}
165-
166134
/**
167135
* Set body payload. This method is used when the HTTP body is not a form-url-encoded string, but another thing.
168136
* Like for example XML. Note: The contents are not part of the OAuth signature
@@ -251,15 +219,6 @@ public String getSanitizedUrl() {
251219
}
252220
}
253221

254-
/**
255-
* @return value set in {@link #setPayload(java.lang.String)}
256-
* @deprecated use {@link #getStringPayload()} or {@link #getByteArrayPayload()}
257-
*/
258-
@Deprecated
259-
public String getBodyContents() {
260-
return getStringPayload();
261-
}
262-
263222
/**
264223
* Returns the body of the request (set in {@link #setPayload(java.lang.String)})
265224
*
@@ -271,15 +230,6 @@ public String getStringPayload() {
271230
return stringPayload;
272231
}
273232

274-
/**
275-
* @return value set in {@link #setPayload(byte[])}
276-
* @deprecated use {@link #getByteArrayPayload() }
277-
*/
278-
@Deprecated
279-
public byte[] getByteBodyContents() {
280-
return getByteArrayPayload();
281-
}
282-
283233
/**
284234
* @return the body of the request (set in {@link #setPayload(byte[])} or in
285235
* {@link #addBodyParameter(java.lang.String, java.lang.String)} )
@@ -342,15 +292,4 @@ public void setFollowRedirects(boolean followRedirects) {
342292
public boolean isFollowRedirects() {
343293
return followRedirects;
344294
}
345-
346-
/**
347-
* always throws UnsupportedOperationException
348-
*
349-
* @return never
350-
* @deprecated Request doesn't couple with Service anymore. It doesn't need it. Look for service somewhere else
351-
*/
352-
@Deprecated
353-
public OAuthService<?> getService() {
354-
throw new UnsupportedOperationException();
355-
}
356295
}

scribejava-core/src/main/java/com/github/scribejava/core/model/HttpClient.java

Lines changed: 0 additions & 36 deletions
This file was deleted.

scribejava-core/src/main/java/com/github/scribejava/core/model/OAuthConfig.java

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,7 @@ public class OAuthConfig {
2828
private com.github.scribejava.core.httpclient.HttpClient httpClient;
2929

3030
public OAuthConfig(String key, String secret) {
31-
this(key, secret, null, null, null, null, null, null, null, null, null, (HttpClientConfig) null, null);
32-
}
33-
34-
/**
35-
* throws UnsupportedOperationException
36-
*
37-
* @param apiKey apiKey
38-
* @param apiSecret apiSecret
39-
* @param callback callback
40-
* @param signatureType signatureType
41-
* @param scope scope
42-
* @param debugStream debugStream
43-
* @param state state
44-
* @param responseType responseType
45-
* @param userAgent userAgent
46-
* @param connectTimeout connectTimeout
47-
* @param readTimeout readTimeout
48-
* @param httpClientConfig httpClientConfig
49-
* @param httpClient httpClient
50-
* @deprecated use
51-
* {@link #OAuthConfig(java.lang.String, java.lang.String, java.lang.String,
52-
* com.github.scribejava.core.model.SignatureType, java.lang.String, java.io.OutputStream, java.lang.String,
53-
* java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer,
54-
* com.github.scribejava.core.httpclient.HttpClientConfig, com.github.scribejava.core.httpclient.HttpClient)}
55-
*/
56-
@Deprecated
57-
public OAuthConfig(String apiKey, String apiSecret, String callback, SignatureType signatureType, String scope,
58-
OutputStream debugStream, String state, String responseType, String userAgent, Integer connectTimeout,
59-
Integer readTimeout, HttpClient.Config httpClientConfig, HttpClient httpClient) {
60-
throw new UnsupportedOperationException("deprecated, use another method, see javadocs");
31+
this(key, secret, null, null, null, null, null, null, null, null, null, null, null);
6132
}
6233

6334
public OAuthConfig(String apiKey, String apiSecret, String callback, SignatureType signatureType, String scope,

scribejava-core/src/main/java/com/github/scribejava/core/model/OAuthRequest.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,6 @@ public class OAuthRequest extends AbstractRequest {
1515

1616
private final OAuthConfig config;
1717

18-
/**
19-
*
20-
* @param verb verb
21-
* @param url url
22-
* @param service service
23-
* @deprecated use {@link #OAuthRequest(com.github.scribejava.core.model.Verb, java.lang.String,
24-
* com.github.scribejava.core.model.OAuthConfig)}
25-
*/
26-
@Deprecated
27-
public OAuthRequest(Verb verb, String url, OAuthService<?> service) {
28-
this(verb, url, service.getConfig());
29-
}
30-
3118
public OAuthRequest(Verb verb, String url, OAuthConfig config) {
3219
super(verb, url);
3320
this.config = config;

scribejava-core/src/main/java/com/github/scribejava/core/model/OAuthRequestAsync.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,13 @@
11
package com.github.scribejava.core.model;
22

3-
import com.github.scribejava.core.oauth.OAuthService;
43
import java.io.IOException;
5-
import java.util.concurrent.Future;
64

75
public class OAuthRequestAsync extends AbstractRequest {
86

9-
/**
10-
* @param verb verb
11-
* @param url url
12-
* @param service service
13-
* @deprecated use {@link #OAuthRequestAsync(com.github.scribejava.core.model.Verb, java.lang.String) }
14-
*/
15-
@Deprecated
16-
public OAuthRequestAsync(Verb verb, String url, OAuthService<?> service) {
17-
this(verb, url);
18-
}
19-
207
public OAuthRequestAsync(Verb verb, String url) {
218
super(verb, url);
229
}
2310

24-
/**
25-
* always throws UnsupportedOperationException
26-
*
27-
* @param <T> T
28-
* @param callback callback
29-
* @param converter converter
30-
* @return never
31-
* @deprecated user {@link OAuthService#execute(com.github.scribejava.core.model.OAuthRequestAsync,
32-
* com.github.scribejava.core.model.OAuthAsyncRequestCallback,
33-
* com.github.scribejava.core.model.OAuthRequestAsync.ResponseConverter) }
34-
*/
35-
@Deprecated
36-
public <T> Future<T> sendAsync(OAuthAsyncRequestCallback<T> callback, ResponseConverter<T> converter) {
37-
throw new UnsupportedOperationException();
38-
}
39-
40-
/**
41-
* always throws UnsupportedOperationException
42-
*
43-
* @param callback callback
44-
* @return never
45-
* @deprecated user {@link OAuthService#execute(com.github.scribejava.core.model.OAuthRequestAsync,
46-
* com.github.scribejava.core.model.OAuthAsyncRequestCallback) }
47-
*/
48-
@Deprecated
49-
public Future<Response> sendAsync(OAuthAsyncRequestCallback<Response> callback) {
50-
throw new UnsupportedOperationException();
51-
}
52-
5311
public interface ResponseConverter<T> {
5412

5513
T convert(Response response) throws IOException;

scribejava-core/src/main/java/com/github/scribejava/core/oauth/OAuthService.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
import com.github.scribejava.core.model.Response;
1414
import com.github.scribejava.core.model.ScribeJavaConfig;
1515
import com.github.scribejava.core.model.Token;
16-
import com.github.scribejava.core.model.Verb;
1716
import java.io.File;
1817

1918
import java.io.IOException;
20-
import java.util.Map;
2119
import java.util.ServiceLoader;
2220
import java.util.concurrent.Future;
2321

@@ -85,39 +83,6 @@ public OAuthConfig getConfig() {
8583

8684
public abstract void signRequest(T token, AbstractRequest request);
8785

88-
/**
89-
*
90-
* @param <T> T
91-
* @param headers headers
92-
* @param httpVerb httpVerb
93-
* @param completeUrl completeUrl
94-
* @param bodyContents bodyContents
95-
* @param callback callback
96-
* @param converter converter
97-
* @return Future
98-
* @deprecated use {@link #execute(com.github.scribejava.core.model.OAuthRequestAsync,
99-
* com.github.scribejava.core.model.OAuthAsyncRequestCallback,
100-
* com.github.scribejava.core.model.OAuthRequestAsync.ResponseConverter)}<br>
101-
* or<br>{@link #execute(com.github.scribejava.core.model.OAuthRequestAsync,
102-
* com.github.scribejava.core.model.OAuthAsyncRequestCallback)}
103-
*/
104-
@Deprecated
105-
public <T> Future<T> executeAsync(Map<String, String> headers, Verb httpVerb, String completeUrl,
106-
String bodyContents, OAuthAsyncRequestCallback<T> callback,
107-
OAuthRequestAsync.ResponseConverter<T> converter) {
108-
109-
final ForceTypeOfHttpRequest forceTypeOfHttpRequest = ScribeJavaConfig.getForceTypeOfHttpRequests();
110-
if (ForceTypeOfHttpRequest.FORCE_SYNC_ONLY_HTTP_REQUESTS == forceTypeOfHttpRequest) {
111-
throw new OAuthException("Cannot use async operations, only sync");
112-
}
113-
if (ForceTypeOfHttpRequest.PREFER_SYNC_ONLY_HTTP_REQUESTS == forceTypeOfHttpRequest) {
114-
config.log("Cannot use async operations, only sync");
115-
}
116-
117-
return httpClient.executeAsync(config.getUserAgent(), headers, httpVerb, completeUrl, bodyContents, callback,
118-
converter);
119-
}
120-
12186
public <T> Future<T> execute(OAuthRequestAsync request, OAuthAsyncRequestCallback<T> callback,
12287
OAuthRequestAsync.ResponseConverter<T> converter) {
12388

0 commit comments

Comments
 (0)