Skip to content

Commit 9ee53d2

Browse files
committed
remove deprecated methods and class after release
1 parent 1c9d5e3 commit 9ee53d2

10 files changed

Lines changed: 1 addition & 270 deletions

File tree

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

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.github.scribejava.core.builder.api.BaseApi;
44
import com.github.scribejava.core.httpclient.HttpClient;
55
import com.github.scribejava.core.httpclient.HttpClientConfig;
6-
import com.github.scribejava.core.httpclient.jdk.JDKHttpClientConfig;
76
import com.github.scribejava.core.model.OAuthConfig;
87
import com.github.scribejava.core.model.OAuthConstants;
98
import com.github.scribejava.core.model.SignatureType;
@@ -119,46 +118,6 @@ public ServiceBuilder responseType(String responseType) {
119118
return this;
120119
}
121120

122-
/**
123-
*
124-
* @param connectTimeout connectTimeout
125-
* @return ServiceBuilder to chain methods
126-
* @deprecated use {@link com.github.scribejava.core.httpclient.jdk.JDKHttpClientConfig} and
127-
* <br> {@link #httpClientConfig(com.github.scribejava.core.httpclient.HttpClientConfig) }
128-
*/
129-
@Deprecated
130-
public ServiceBuilder connectTimeout(Integer connectTimeout) {
131-
final JDKHttpClientConfig jdkHttpClientConfig;
132-
if (httpClientConfig instanceof JDKHttpClientConfig) {
133-
jdkHttpClientConfig = (JDKHttpClientConfig) httpClientConfig;
134-
} else {
135-
jdkHttpClientConfig = new JDKHttpClientConfig();
136-
httpClientConfig = jdkHttpClientConfig;
137-
}
138-
jdkHttpClientConfig.setConnectTimeout(connectTimeout);
139-
return this;
140-
}
141-
142-
/**
143-
*
144-
* @param readTimeout readTimeout
145-
* @return ServiceBuilder to chain methods
146-
* @deprecated use {@link com.github.scribejava.core.httpclient.jdk.JDKHttpClientConfig} and
147-
* <br> {@link #httpClientConfig(com.github.scribejava.core.httpclient.HttpClientConfig) }
148-
*/
149-
@Deprecated
150-
public ServiceBuilder readTimeout(Integer readTimeout) {
151-
final JDKHttpClientConfig jdkHttpClientConfig;
152-
if (httpClientConfig instanceof JDKHttpClientConfig) {
153-
jdkHttpClientConfig = (JDKHttpClientConfig) httpClientConfig;
154-
} else {
155-
jdkHttpClientConfig = new JDKHttpClientConfig();
156-
httpClientConfig = jdkHttpClientConfig;
157-
}
158-
jdkHttpClientConfig.setReadTimeout(readTimeout);
159-
return this;
160-
}
161-
162121
public ServiceBuilder httpClientConfig(HttpClientConfig httpClientConfig) {
163122
Preconditions.checkNotNull(httpClientConfig, "httpClientConfig can't be null");
164123
this.httpClientConfig = httpClientConfig;

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

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

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

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

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

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.github.scribejava.core.httpclient.HttpClient;
44
import com.github.scribejava.core.httpclient.HttpClientConfig;
5-
import com.github.scribejava.core.httpclient.jdk.JDKHttpClientConfig;
65
import java.io.IOException;
76
import java.io.OutputStream;
87

@@ -87,32 +86,6 @@ public void log(String message) {
8786
}
8887
}
8988

90-
/**
91-
*
92-
* @return Connect Timeout
93-
* @deprecated use {@link JDKHttpClientConfig}
94-
*/
95-
@Deprecated
96-
public Integer getConnectTimeout() {
97-
if (httpClientConfig instanceof JDKHttpClientConfig) {
98-
return ((JDKHttpClientConfig) httpClientConfig).getConnectTimeout();
99-
}
100-
return null;
101-
}
102-
103-
/**
104-
*
105-
* @return Read Timeout
106-
* @deprecated use {@link JDKHttpClientConfig}
107-
*/
108-
@Deprecated
109-
public Integer getReadTimeout() {
110-
if (httpClientConfig instanceof JDKHttpClientConfig) {
111-
return ((JDKHttpClientConfig) httpClientConfig).getReadTimeout();
112-
}
113-
return null;
114-
}
115-
11689
public HttpClientConfig getHttpClientConfig() {
11790
return httpClientConfig;
11891
}

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* The representation of an OAuth HttpRequest.
1515
*/
16-
public class OAuthRequest extends AbstractRequest {
16+
public class OAuthRequest {
1717

1818
private static final String OAUTH_PREFIX = "oauth_";
1919

@@ -44,18 +44,6 @@ public OAuthRequest(Verb verb, String url) {
4444
this.url = url;
4545
}
4646

47-
/**
48-
*
49-
* @param verb verb
50-
* @param url url
51-
* @param config unused
52-
* @deprecated use {@link #OAuthRequest(com.github.scribejava.core.model.Verb, java.lang.String) }
53-
*/
54-
@Deprecated
55-
public OAuthRequest(Verb verb, String url, OAuthConfig config) {
56-
this(verb, url);
57-
}
58-
5947
/**
6048
* Adds an OAuth parameter.
6149
*

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

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

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

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
import java.io.IOException;
44
import java.io.InputStream;
5-
import java.net.HttpURLConnection;
6-
import java.net.UnknownHostException;
7-
import java.util.HashMap;
8-
import java.util.List;
95
import java.util.Map;
10-
import java.util.Map.Entry;
11-
import com.github.scribejava.core.exceptions.OAuthException;
126
import com.github.scribejava.core.utils.StreamUtils;
137

148
public class Response {
@@ -19,25 +13,6 @@ public class Response {
1913
private String body;
2014
private InputStream stream;
2115

22-
/**
23-
*
24-
* @param code code
25-
* @param message message
26-
* @param headers headers
27-
* @param body body
28-
* @param stream stream
29-
* @deprecated use either {@link #Response(int, java.lang.String, java.util.Map, java.io.InputStream) }
30-
* or {@link #Response(int, java.lang.String, java.util.Map, java.lang.String) }
31-
*/
32-
@Deprecated
33-
public Response(int code, String message, Map<String, String> headers, String body, InputStream stream) {
34-
this.code = code;
35-
this.message = message;
36-
this.headers = headers;
37-
this.body = body;
38-
this.stream = stream;
39-
}
40-
4116
private Response(int code, String message, Map<String, String> headers) {
4217
this.code = code;
4318
this.message = message;
@@ -54,25 +29,6 @@ public Response(int code, String message, Map<String, String> headers, String bo
5429
this.body = body;
5530
}
5631

57-
/**
58-
*
59-
* @param connection connection
60-
* @throws IOException
61-
* @deprecated use {@link #Response(int, java.lang.String, java.util.Map, java.lang.String, java.io.InputStream) }
62-
*/
63-
@Deprecated
64-
Response(HttpURLConnection connection) throws IOException {
65-
try {
66-
connection.connect();
67-
code = connection.getResponseCode();
68-
message = connection.getResponseMessage();
69-
headers = parseHeaders(connection);
70-
stream = isSuccessful() ? connection.getInputStream() : connection.getErrorStream();
71-
} catch (UnknownHostException e) {
72-
throw new OAuthException("The IP address of a host could not be determined.", e);
73-
}
74-
}
75-
7632
private String parseBodyContents() throws IOException {
7733
if (stream == null) {
7834
return null;
@@ -85,26 +41,6 @@ private String parseBodyContents() throws IOException {
8541
return body;
8642
}
8743

88-
/**
89-
*
90-
* @param conn conn
91-
* @return
92-
* @deprecated use {@link OAuthRequest#parseHeaders(java.net.HttpURLConnection) }
93-
*/
94-
@Deprecated
95-
private Map<String, String> parseHeaders(HttpURLConnection conn) {
96-
final Map<String, String> headers = new HashMap<>();
97-
for (Entry<String, List<String>> entry : conn.getHeaderFields().entrySet()) {
98-
final String key = entry.getKey();
99-
if ("Content-Encoding".equalsIgnoreCase(key)) {
100-
headers.put("Content-Encoding", entry.getValue().get(0));
101-
} else {
102-
headers.put(key, entry.getValue().get(0));
103-
}
104-
}
105-
return headers;
106-
}
107-
10844
public final boolean isSuccessful() {
10945
return code >= 200 && code < 400;
11046
}

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

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

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,6 @@ private static HttpClient getClient(HttpClientConfig config) {
5050
return null;
5151
}
5252

53-
/**
54-
*
55-
* @throws IOException IOException
56-
* @deprecated use {@link #close() }
57-
*/
58-
@Deprecated
59-
public void closeAsyncClient() throws IOException {
60-
close();
61-
}
62-
6353
@Override
6454
public void close() throws IOException {
6555
httpClient.close();

scribejava-core/src/main/java/com/github/scribejava/core/utils/Preconditions.java

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

3-
import java.util.Locale;
4-
import java.util.regex.Pattern;
5-
import com.github.scribejava.core.model.OAuthConstants;
6-
73
/**
84
* Utils for checking preconditions and invariants
95
*/
106
public abstract class Preconditions {
117

128
private static final String DEFAULT_MESSAGE = "Received an invalid parameter";
139

14-
// scheme = alpha *( alpha | digit | "+" | "-" | "." )
15-
private static final String URL_REGEXP = "^[a-zA-Z][a-zA-Z0-9+.-]*://\\S+";
16-
1710
/**
1811
* Checks that an object is not null.
1912
*
@@ -51,41 +44,6 @@ public static boolean hasText(String str) {
5144
return false;
5245
}
5346

54-
55-
/**
56-
* Checks that a URL is valid
57-
*
58-
* @param url any string
59-
* @param errorMsg error message
60-
*
61-
* @deprecated will be just removed. not used in ScribeJava
62-
*/
63-
@Deprecated
64-
public static void checkValidUrl(String url, String errorMsg) {
65-
checkEmptyString(url, errorMsg);
66-
check(isUrl(url), errorMsg);
67-
}
68-
69-
/**
70-
* Checks that a URL is a valid OAuth callback
71-
*
72-
* @param url any string
73-
* @param errorMsg error message
74-
*
75-
* @deprecated will be just removed. not used in ScribeJava
76-
*/
77-
@Deprecated
78-
public static void checkValidOAuthCallback(String url, String errorMsg) {
79-
checkEmptyString(url, errorMsg);
80-
if (url.toLowerCase(Locale.getDefault()).compareToIgnoreCase(OAuthConstants.OUT_OF_BAND) != 0) {
81-
check(isUrl(url), errorMsg);
82-
}
83-
}
84-
85-
private static boolean isUrl(String url) {
86-
return Pattern.compile(URL_REGEXP).matcher(url).matches();
87-
}
88-
8947
private static void check(boolean requirements, String error) {
9048
if (!requirements) {
9149
throw new IllegalArgumentException(hasText(error) ? error : DEFAULT_MESSAGE);

0 commit comments

Comments
 (0)