From 60e5f732dec063fbbdb1cee580e2a4794f96f2e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 10:39:05 +0000 Subject: [PATCH 1/2] Bump org.expath.http.client:http-client-java from 1.4.1 to 1.5.2 Bumps [org.expath.http.client:http-client-java](https://github.com/expath/expath-http-client-java) from 1.4.1 to 1.5.2. - [Commits](https://github.com/expath/expath-http-client-java/compare/http-client-1.4.1...http-client-1.5.2) --- updated-dependencies: - dependency-name: org.expath.http.client:http-client-java dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- extensions/expath/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/expath/pom.xml b/extensions/expath/pom.xml index 4d2631c7009..49837c5c31a 100644 --- a/extensions/expath/pom.xml +++ b/extensions/expath/pom.xml @@ -71,7 +71,7 @@ org.expath.http.client http-client-java - 1.4.1 + 1.5.2 From dc541839d181818e815a2bcb309be9b0b66bf3a8 Mon Sep 17 00:00:00 2001 From: Patrick Reinhart Date: Fri, 30 Aug 2024 12:58:23 +0200 Subject: [PATCH 2/2] Fixes compile errors caused by API change Signed-off-by: Patrick Reinhart --- .../httpclient/model/exist/EXistResult.java | 18 +++++++++++++----- .../model/exist/EXistTreeBuilder.java | 4 +++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/extensions/expath/src/main/java/org/expath/httpclient/model/exist/EXistResult.java b/extensions/expath/src/main/java/org/expath/httpclient/model/exist/EXistResult.java index c5ddb470034..6b24fd70c6c 100644 --- a/extensions/expath/src/main/java/org/expath/httpclient/model/exist/EXistResult.java +++ b/extensions/expath/src/main/java/org/expath/httpclient/model/exist/EXistResult.java @@ -39,12 +39,20 @@ import org.exist.xquery.XPathException; import org.exist.xquery.XQueryContext; import org.exist.xquery.modules.ModuleUtils; -import org.exist.xquery.value.*; +import org.exist.xquery.value.Base64BinaryValueType; +import org.exist.xquery.value.BinaryValueFromFile; +import org.exist.xquery.value.NodeValue; +import org.exist.xquery.value.Sequence; +import org.exist.xquery.value.StringValue; +import org.exist.xquery.value.Type; +import org.exist.xquery.value.ValueSequence; import org.expath.httpclient.HttpClientException; import org.expath.httpclient.HttpResponse; import org.expath.httpclient.model.Result; import org.xml.sax.SAXException; +import static org.expath.httpclient.HttpClientError.HC001; + /** * @author Adam Retter */ @@ -78,7 +86,7 @@ public void add(final Reader reader, final Charset charset) throws HttpClientExc builder.append(cbuf, 0, read); } } catch(final IOException ioe) { - throw new HttpClientException("Unable to add string value to result: " + ioe.getMessage(), ioe); + throw new HttpClientException(HC001, "Unable to add string value to result: " + ioe.getMessage(), ioe); } finally { try { reader.close(); @@ -101,7 +109,7 @@ public void add(final InputStream is) throws HttpClientException { result.add(BinaryValueFromFile.getInstance(context, new Base64BinaryValueType(), tempFile, (isClosed, file) -> temporaryFileManager.returnTemporaryFile(file), null)); } catch(final XPathException | IOException xpe) { - throw new HttpClientException("Unable to add binary value to result:" + xpe.getMessage(), xpe); + throw new HttpClientException(HC001, "Unable to add binary value to result:" + xpe.getMessage(), xpe); } finally { try { is.close(); @@ -117,7 +125,7 @@ public void add(final Source src) throws HttpClientException { final NodeValue nodeValue = ModuleUtils.sourceToXML(context, src, null); result.add(nodeValue); } catch(final SAXException | IOException saxe) { - throw new HttpClientException("Unable to add Source to result:" + saxe.getMessage(), saxe); + throw new HttpClientException(HC001, "Unable to add Source to result:" + saxe.getMessage(), saxe); } } @@ -141,7 +149,7 @@ public void add(final HttpResponse response) throws HttpClientException { result = newResult; } } catch (final XPathException xpe) { - throw new HttpClientException("Unable to add HttpResponse to result:" + xpe.getMessage(), xpe); + throw new HttpClientException(HC001, "Unable to add HttpResponse to result:" + xpe.getMessage(), xpe); } } diff --git a/extensions/expath/src/main/java/org/expath/httpclient/model/exist/EXistTreeBuilder.java b/extensions/expath/src/main/java/org/expath/httpclient/model/exist/EXistTreeBuilder.java index 11e8d4d05f2..85da486d913 100644 --- a/extensions/expath/src/main/java/org/expath/httpclient/model/exist/EXistTreeBuilder.java +++ b/extensions/expath/src/main/java/org/expath/httpclient/model/exist/EXistTreeBuilder.java @@ -34,6 +34,8 @@ import javax.xml.XMLConstants; +import static org.expath.httpclient.HttpClientError.HC001; + /** * @author Adam Retter */ @@ -93,7 +95,7 @@ public void outputHeaders(HeaderSet headers) endElem(); } catch ( ToolsException ex ) { - throw new HttpClientException("Error building the header " + name, ex); + throw new HttpClientException(HC001, "Error building the header " + name, ex); } } }