Skip to content

Commit 5858a79

Browse files
committed
Remove support for custom URLStreamHandler (#927)
1 parent 0efa66f commit 5858a79

File tree

2 files changed

+1
-60
lines changed

2 files changed

+1
-60
lines changed

src/main/java/com/stripe/net/StripeRequest.java

+1-23
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
import com.stripe.exception.ApiConnectionException;
55
import com.stripe.exception.AuthenticationException;
66
import com.stripe.exception.StripeException;
7-
import com.stripe.util.ReflectionUtils;
87
import com.stripe.util.StringUtils;
98
import java.io.IOException;
109
import java.net.URL;
11-
import java.net.URLStreamHandler;
1210
import java.util.HashMap;
1311
import java.util.Map;
1412
import java.util.UUID;
@@ -18,14 +16,6 @@
1816
@Value
1917
@Accessors(fluent = true)
2018
public class StripeRequest {
21-
/*
22-
* Set this property to override your environment's default
23-
* URLStreamHandler; Settings the property should not be needed in most
24-
* environments.
25-
*/
26-
private static final String CUSTOM_URL_STREAM_HANDLER_PROPERTY_NAME =
27-
"com.stripe.net.customURLStreamHandler";
28-
2919
/** The HTTP method for the request (GET, POST or DELETE). */
3020
ApiResource.RequestMethod method;
3121

@@ -100,19 +90,7 @@ private static URL buildURL(
10090
}
10191
}
10292

103-
URL url;
104-
String customUrlStreamHandlerClassName =
105-
System.getProperty(CUSTOM_URL_STREAM_HANDLER_PROPERTY_NAME, null);
106-
if (customUrlStreamHandlerClassName != null) {
107-
// instantiate the custom handler provided
108-
Class<URLStreamHandler> clazz =
109-
(Class<URLStreamHandler>) ReflectionUtils.getClassByName(customUrlStreamHandlerClassName);
110-
URLStreamHandler customHandler = ReflectionUtils.newInstance(clazz);
111-
url = new URL(null, sb.toString(), customHandler);
112-
} else {
113-
url = new URL(sb.toString());
114-
}
115-
return url;
93+
return new URL(sb.toString());
11694
}
11795

11896
private static HttpContent buildContent(

src/main/java/com/stripe/util/ReflectionUtils.java

-37
This file was deleted.

0 commit comments

Comments
 (0)