Migrate to ApacheHttpClient 5.x Classes Namespace from 4.x

MSAL

Mapping of all the compatible classes of ApacheHttpClient 5.x from 4.x.

org.openrewrite.apache.httpclient5.UpgradeApacheHttpClient_5_ClassMapping
mod run . --recipe=org.openrewrite.apache.httpclient5.UpgradeApacheHttpClient_5_ClassMapping

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Stop inheriting constants from HttpClient 4 HttpStatus
  2. Rename package name org.apache.http.client.methods to org.apache.hc.client5.http.classic.methods
  3. Change type org.apache.hc.client5.http.classic.methods.CloseableHttpResponse to org.apache.hc.client5.http.impl.classic.CloseableHttpResponse
  4. Change type HttpEntityEnclosingRequestBase to HttpUriRequestBase
  5. Change type HttpRequestBase to HttpUriRequestBase
  6. Rename package name org.apache.http.client.entity to org.apache.hc.client5.http.entity
  7. Rename package name org.apache.http.client.protocol to org.apache.hc.client5.http.protocol
  8. Rename package name org.apache.http.conn.socket to org.apache.hc.client5.http.socket
  9. Rename package name org.apache.http.ssl to org.apache.hc.core5.ssl
  10. Rename package name org.apache.http.concurrent to org.apache.hc.core5.concurrent
  11. Rename package name org.apache.http.impl.auth to org.apache.hc.client5.http.impl.auth
  12. Rename package name org.apache.http.impl.cookie to org.apache.hc.client5.http.impl.cookie
  13. Change type org.apache.hc.client5.http.impl.cookie.PublicSuffixListParser to org.apache.hc.client5.http.psl.PublicSuffixListParser
  14. Change type org.apache.hc.client5.http.impl.cookie.DateUtils to org.apache.hc.client5.http.utils.DateUtils
  15. Change type ProxyAuthenticationStrategy to DefaultAuthenticationStrategy
  16. Rename package name org.apache.http.impl.client to org.apache.hc.client5.http.impl.classic
  17. Change type org.apache.http.impl.client.BasicAuthCache to org.apache.hc.client5.http.impl.auth.BasicAuthCache
  18. Change type org.apache.hc.client5.http.impl.classic.BasicAuthCache to org.apache.hc.client5.http.impl.auth.BasicAuthCache
  19. Change type org.apache.hc.client5.http.impl.classic.HttpAuthenticator to org.apache.hc.client5.http.impl.auth.HttpAuthenticator
  20. Change type org.apache.hc.client5.http.impl.classic.SystemDefaultCredentialsProvider to org.apache.hc.client5.http.impl.auth.SystemDefaultCredentialsProvider
  21. Change type org.apache.hc.client5.http.impl.classic.DefaultClientConnectionReuseStrategy to org.apache.hc.client5.http.impl.DefaultClientConnectionReuseStrategy
  22. Change type org.apache.hc.client5.http.impl.classic.DefaultRedirectStrategy to org.apache.hc.client5.http.impl.DefaultRedirectStrategy
  23. Change type org.apache.hc.client5.http.impl.classic.RedirectLocations to org.apache.hc.client5.http.protocol.RedirectLocations
  24. Change type org.apache.hc.client5.http.impl.classic.BasicCookieStore to org.apache.hc.client5.http.cookie.BasicCookieStore
  25. Change type org.apache.hc.client5.http.impl.classic.DefaultConnectionKeepAliveStrategy to org.apache.hc.client5.http.impl.DefaultConnectionKeepAliveStrategy
  26. Change type org.apache.hc.client5.http.impl.classic.IdleConnectionEvictor to org.apache.hc.client5.http.impl.IdleConnectionEvictor
  27. Change type org.apache.hc.client5.http.impl.classic.TunnelRefusedException to org.apache.hc.client5.http.impl.TunnelRefusedException
  28. Change type org.apache.hc.client5.http.impl.classic.NoopUserTokenHandler to org.apache.hc.client5.http.impl.NoopUserTokenHandler
  29. Change type org.apache.hc.client5.http.impl.classic.DefaultUserTokenHandler to org.apache.hc.client5.http.impl.DefaultUserTokenHandler
  30. Change type org.apache.hc.client5.http.impl.classic.BasicCredentialsProvider to org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider
  31. Change type AuthSchemeProvider to AuthSchemeFactory
  32. Change type AuthSchemes to StandardAuthScheme
  33. Rename package name org.apache.http.auth to org.apache.hc.client5.http.auth
  34. Rename package name org.apache.http.cookie to org.apache.hc.client5.http.cookie
  35. Rename package name org.apache.http.annotation to org.apache.hc.core5.annotation
  36. Rename package name org.apache.http.client.config to org.apache.hc.client5.http.config
  37. Replace constant with another constant
  38. Replace constant with another constant
  39. Replace constant with another constant
  40. Rename package name org.apache.http.annotation to org.apache.hc.core5.annotation
  41. Replace constant with another constant
  42. Change type org.apache.http.entity.mime.HttpMultipartMode to org.apache.hc.client5.http.entity.mime.HttpMultipartMode
  43. Rename package name org.apache.http.entity to org.apache.hc.core5.http.io.entity
  44. Rename package name org.apache.hc.core5.http.io.entity.mime to org.apache.hc.client5.http.entity.mime
  45. Rename package name org.apache.hc.client5.http.entity.mime.content to org.apache.hc.client5.http.entity.mime
  46. Change type org.apache.hc.core5.http.io.entity.ContentLengthStrategy to org.apache.hc.core5.http.ContentLengthStrategy
  47. Change type org.apache.hc.core5.http.io.entity.ContentType to org.apache.hc.core5.http.ContentType
  48. Change type MinimalField to MimeField
  49. Change type MinimalField to MimeField
  50. Replace new StringEntity(String, String) with new StringEntity(String, Charset)
  51. Replace new UrlEncodedFormEntity(List, String) with new UrlEncodedFormEntity(Iterable, Charset)
  52. Rename package name org.apache.http.impl.bootstrap to org.apache.hc.core5.http.impl.bootstrap
  53. Rename package name org.apache.http.impl.execchain to org.apache.hc.client5.http.impl.classic
  54. Change type org.apache.hc.client5.http.impl.classic.TunnelRefusedException to org.apache.hc.client5.http.impl.TunnelRefusedException
  55. Rename package name org.apache.http.impl.io to org.apache.hc.core5.http.impl.io
  56. Change type org.apache.hc.core5.http.impl.io.DefaultHttpResponseParserFactory to org.apache.hc.client5.http.impl.io.DefaultHttpResponseParserFactory
  57. Rename package name org.apache.http.io to org.apache.hc.core5.http.io
  58. Rename package name org.apache.http.message to org.apache.hc.core5.http.message
  59. Rename package name org.apache.http.pool to org.apache.hc.core5.pool
  60. Replace constant with another constant
  61. Replace constant with another constant
  62. Change type HTTP to HttpHeaders
  63. Rename package name org.apache.http.protocol to org.apache.hc.core5.http.protocol
  64. Change type org.apache.hc.core5.http.protocol.HttpService to org.apache.hc.core5.http.impl.io.HttpService
  65. Change type org.apache.hc.core5.http.protocol.HttpRequestExecutor to org.apache.hc.core5.http.impl.io.HttpRequestExecutor
  66. Change type org.apache.hc.core5.http.protocol.HttpRequestHandler to org.apache.hc.core5.http.io.HttpRequestHandler
  67. Rename package name org.apache.http.util to org.apache.hc.core5.util
  68. Change type org.apache.hc.core5.util.EntityUtils to org.apache.hc.core5.http.io.entity.EntityUtils
  69. Change type org.apache.http.client.utils.URIBuilder to org.apache.hc.core5.net.URIBuilder
  70. Change type org.apache.http.client.utils.URLEncodedUtils to org.apache.hc.core5.net.URLEncodedUtils
  71. Change type org.apache.http.client.utils.URIUtils to org.apache.hc.client5.http.utils.URIUtils
  72. Change type org.apache.http.client.utils.DateUtils to org.apache.hc.client5.http.utils.DateUtils
  73. Migrate setCredentials to ApacheHttpClient 5.x CredentialsStore
  74. Migrate clear to ApacheHttpClient 5.x CredentialsStore
  75. Change type org.apache.http.client.CredentialsProvider to org.apache.hc.client5.http.auth.CredentialsProvider
  76. Change type ResponseHandler to HttpClientResponseHandler
  77. Rename package name org.apache.http.client to org.apache.hc.client5.http
  78. Change type org.apache.hc.client5.http.AuthCache to org.apache.hc.client5.http.auth.AuthCache
  79. Change type org.apache.hc.client5.http.BackoffManager to org.apache.hc.client5.http.classic.BackoffManager
  80. Change type org.apache.hc.client5.http.HttpClient to org.apache.hc.client5.http.classic.HttpClient
  81. Change type HttpRequestRetryHandler to HttpRequestRetryStrategy
  82. Change type org.apache.hc.client5.http.ConnectionBackoffStrategy to org.apache.hc.client5.http.classic.ConnectionBackoffStrategy
  83. Change type org.apache.hc.client5.http.CookieStore to org.apache.hc.client5.http.cookie.CookieStore
  84. Change type org.apache.hc.client5.http.RedirectStrategy to org.apache.hc.client5.http.protocol.RedirectStrategy
  85. Change type RequestBuilder to ClassicRequestBuilder
  86. Rename package name org.apache.http.config to org.apache.hc.core5.http.config
  87. Change type org.apache.hc.core5.http.config.SocketConfig to org.apache.hc.core5.http.io.SocketConfig
  88. Change type org.apache.hc.core5.http.config.SocketConfig.Builder to org.apache.hc.core5.http.io.SocketConfig.Builder
  89. Rename package name org.apache.http.impl.nio.client to org.apache.hc.client5.http.impl.async
  90. Rename package name org.apache.http.impl to org.apache.hc.core5.http.impl.io
  91. Change type org.apache.hc.core5.http.impl.io.EnglishReasonPhraseCatalog to org.apache.hc.core5.http.impl.EnglishReasonPhraseCatalog
  92. Change type org.apache.hc.core5.http.impl.io.DefaultConnectionReuseStrategy to org.apache.hc.core5.http.impl.DefaultConnectionReuseStrategy
  93. Change type org.apache.hc.core5.http.impl.io.DefaultHttpRequestFactory to org.apache.hc.core5.http.impl.nio.DefaultHttpRequestFactory
  94. Change type org.apache.hc.core5.http.impl.io.DefaultHttpResponseFactory to org.apache.hc.core5.http.impl.nio.DefaultHttpResponseFactory
  95. Rename package name org.apache.http.conn.util to org.apache.hc.client5.http.psl
  96. Change type org.apache.hc.client5.http.psl.DnsUtils to org.apache.hc.client5.http.utils.DnsUtils
  97. Change type org.apache.hc.client5.http.psl.InetAddressUtils to org.apache.hc.core5.net.InetAddressUtils
  98. Rename package name org.apache.http.conn.routing to org.apache.hc.client5.http
  99. Change type org.apache.hc.client5.http.BasicRouteDirector to org.apache.hc.client5.http.impl.routing.BasicRouteDirector
  100. Change type org.apache.hc.client5.http.HttpRouteDirector to org.apache.hc.client5.http.routing.HttpRouteDirector
  101. Change type org.apache.hc.client5.http.HttpRoutePlanner to org.apache.hc.client5.http.routing.HttpRoutePlanner
  102. Rename package name org.apache.http.conn.ssl to org.apache.hc.core5.ssl
  103. Change type org.apache.hc.core5.ssl.SSLConnectionSocketFactory to org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory
  104. Change type org.apache.hc.core5.ssl.NoopHostnameVerifier to org.apache.hc.client5.http.ssl.NoopHostnameVerifier
  105. Change type org.apache.hc.core5.ssl.DefaultHostnameVerifier to org.apache.hc.client5.http.ssl.DefaultHostnameVerifier
  106. Change type org.apache.hc.core5.ssl.TrustSelfSignedStrategy to org.apache.hc.client5.http.ssl.TrustSelfSignedStrategy
  107. Change type org.apache.hc.core5.ssl.TrustAllStrategy to org.apache.hc.client5.http.ssl.TrustAllStrategy
  108. Change type org.apache.hc.core5.ssl.SubjectName to org.apache.hc.client5.http.ssl.SubjectName
  109. Rename package name org.apache.http.impl.conn to org.apache.hc.client5.http.impl.io
  110. Change type org.apache.hc.client5.http.impl.io.SystemDefaultDnsResolver to org.apache.hc.client5.http.SystemDefaultDnsResolver
  111. Change type org.apache.hc.client5.http.impl.io.Wire to org.apache.hc.client5.http.impl.Wire
  112. Change type org.apache.hc.client5.http.impl.io.InMemoryDnsResolver to org.apache.hc.client5.http.impl.InMemoryDnsResolver
  113. Change type org.apache.hc.client5.http.impl.io.ConnectionShutdownException to org.apache.hc.client5.http.impl.ConnectionShutdownException
  114. Change type org.apache.hc.client5.http.impl.io.DefaultSchemePortResolver to org.apache.hc.client5.http.impl.DefaultSchemePortResolver
  115. Change type org.apache.hc.client5.http.impl.io.DefaultProxyRoutePlanner to org.apache.hc.client5.http.impl.routing.DefaultProxyRoutePlanner
  116. Change type org.apache.hc.client5.http.impl.io.DefaultRoutePlanner to org.apache.hc.client5.http.impl.routing.DefaultRoutePlanner
  117. Change type org.apache.hc.client5.http.impl.io.SystemDefaultRoutePlanner to org.apache.hc.client5.http.impl.routing.SystemDefaultRoutePlanner
  118. Change type org.apache.hc.client5.http.impl.io.DefaultHttpResponseParser to org.apache.hc.core5.http.impl.io.DefaultHttpResponseParser
  119. Change type PoolingClientConnectionManager to PoolingHttpClientConnectionManager
  120. Change type SchemeRegistryFactory to DefaultSchemePortResolver
  121. Rename package name org.apache.http.conn to org.apache.hc.client5.http
  122. Change type org.apache.hc.client5.http.ManagedHttpClientConnection to org.apache.hc.client5.http.io.ManagedHttpClientConnection
  123. Change type org.apache.hc.client5.http.HttpClientConnectionManager to org.apache.hc.client5.http.io.HttpClientConnectionManager
  124. Change type org.apache.hc.client5.http.HttpClientConnectionOperator to org.apache.hc.client5.http.io.HttpClientConnectionOperator
  125. Change type org.apache.hc.client5.http.EofSensorWatcher to org.apache.hc.core5.http.io.EofSensorWatcher
  126. Change type org.apache.hc.client5.http.EofSensorInputStream to org.apache.hc.core5.http.io.EofSensorInputStream
  127. Change type org.apache.hc.client5.http.HttpConnectionFactory to org.apache.hc.core5.http.io.HttpConnectionFactory
  128. Change type HttpRequest to ClassicHttpRequest
  129. Change type HttpResponse to ClassicHttpResponse
  130. Rename package name org.apache.http to org.apache.hc.core5.http
  131. Rename package name org.apache.hc.core5.http.params to org.apache.http.params
  132. Add comment to import statement matching org.apache.http.params..*
  133. Change type org.apache.hc.core5.http.RequestLine to org.apache.hc.core5.http.message.RequestLine
  134. Change type org.apache.hc.core5.http.HttpClientConnection to org.apache.hc.core5.http.io.HttpClientConnection
  135. Change type org.apache.hc.core5.http.StatusLine to org.apache.hc.core5.http.message.StatusLine
  136. Change type org.apache.hc.core5.http.HttpServerConnection to org.apache.hc.core5.http.io.HttpServerConnection
  137. Change type org.apache.hc.core5.http.HttpConnectionFactory to org.apache.hc.core5.http.io.HttpConnectionFactory
  138. Change type HttpEntityEnclosingRequest to HttpEntityContainer
  139. Reorder method arguments
  140. Reorder method arguments
  141. Reorder method arguments