Skip to content

Commit

Permalink
Allow via HttpClientFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Jan 31, 2024
1 parent 92dc7f3 commit 89d331c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ public HttpClientUrlDownloader (@Nonnull final HttpClientFactory aHCF)
if (LOGGER.isDebugEnabled ())
LOGGER.debug ("Trying to download CRL via HttpClient from '" + sURL + "'");

try (final HttpClientManager aHCF = new HttpClientManager (m_aHCF))
try (final HttpClientManager aHCM = new HttpClientManager (m_aHCF))
{
final HttpGet aGet = new HttpGet (sURL);
return aHCF.execute (aGet, new ResponseHandlerByteArray ());
return aHCM.execute (aGet, new ResponseHandlerByteArray ());
}
catch (final Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.slf4j.LoggerFactory;

import com.helger.commons.ValueEnforcer;
import com.helger.httpclient.HttpClientFactory;
import com.helger.httpclient.HttpClientSettings;
import com.helger.peppol.utils.CRLCache;
import com.helger.peppol.utils.CRLDownloader;
Expand Down Expand Up @@ -57,10 +58,22 @@ public PeppolCRLDownloader (@Nonnull final HttpClientSettings aHCS)
super (new HttpClientUrlDownloader (aHCS));
}

/**
* Constructor using specific settings
*
* @param aHCF
* The {@link HttpClientFactory} to use. May not be <code>null</code>.
*/
public PeppolCRLDownloader (@Nonnull final HttpClientFactory aHCF)
{
super (new HttpClientUrlDownloader (aHCF));
}

/**
* Install a global CRLCache using this CRL downloader and the default
* {@link Phase4PeppolHttpClientSettings}.
*/
@Deprecated (forRemoval = true, since = "2.7.5")
public static void setAsDefaultCRLCache ()
{
setAsDefaultCRLCache (new Phase4PeppolHttpClientSettings ());
Expand Down

0 comments on commit 89d331c

Please sign in to comment.