You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by GitBox <gi...@apache.org> on 2022/04/24 11:25:14 UTC
[GitHub] [jena] afs commented on a diff in pull request #1267: JENA-2153: Write pretty JSON-LD 1.1
afs commented on code in PR #1267:
URL: https://github.com/apache/jena/pull/1267#discussion_r857110970
##########
jena-arq/src/main/java/org/apache/jena/sparql/exec/http/Service.java:
##########
@@ -241,6 +242,37 @@ private static QuerySendMode chooseQuerySendMode(String serviceURL, Context cont
return context.get(httpServiceSendMode, dftValue);
}
+ private static QuerySendMode chooseQuerySendMode2(String serviceURL, Context context, QuerySendMode dftValue) {
+ if ( context == null )
+ return dftValue;
+ Object querySendMode = context.get(httpServiceSendMode, dftValue);
+ if ( querySendMode == null )
+ return dftValue;
+
+ if (querySendMode instanceof QuerySendMode)
+ // handle enum type from Java API
+ return (QuerySendMode) querySendMode;
+
+ if (querySendMode instanceof String) {
+ String str = (String) querySendMode;
+ // Specials.
+ if ( "POST".equalsIgnoreCase(str) )
+ return QuerySendMode.asPost;
+ if ( "GET".equalsIgnoreCase(str) )
+ return QuerySendMode.asGetAlways;
+ try {
+ // "asGetWithLimitForm", "asGetWithLimitBody", "asGetAlways", "asPostForm,asPost"
+ return QuerySendMode.valueOf((String) querySendMode);
+ } catch (IllegalArgumentException ex) {
+ FmtLog.warn(Service.class, "Failed to interrept '%s' as a query send mode - ignored", querySendMode);
Review Comment:
Thanks for catching that.
My bad - got my branches mixed up. This is not supposed to be in this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org