*/
private static URLStreamHandler getFallbackStreamHandler(String protocol) {
if (GET_URL_STREAM_HANDLER == null) {
return null;
}
URLStreamHandler existingHandler =
(URLStreamHandler) invoke(null, GET_URL_STREAM_HANDLER, protocol);
if (existingHandler.getClass().getName().equals(
LocalURLFetchServiceStreamHandler.class.getName())) {
Method getFallbackHandler =
getDeclaredMethod(existingHandler.getClass(), "getFallbackHandler");
return (URLStreamHandler) invoke(existingHandler, getFallbackHandler);
}
return existingHandler;
}