gitgabrio commented on code in PR #3572:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3572#discussion_r1675600188
##########
kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/io/CachedContentLoader.java:
##########
@@ -91,10 +90,13 @@ public InputStream getInputStream() {
}
}
- protected abstract byte[] loadURI(URI uri);
-
- @Override
- public URI uri() {
- return uri;
+ protected static String trimScheme(String uri, String scheme) {
Review Comment:
drools repository is stuffed with methods exactly for that, in the
[drools-util](https://github.com/apache/incubator-kie-drools/tree/main/drools-util)
module: maybe it would be worth to avoid code-duplication, since
`kogito-serverless-workflow` already inherit it
##########
kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/io/ClassPathContentLoader.java:
##########
@@ -86,6 +71,17 @@ private byte[] loadBytes(URL r) {
}
}
+ static String uriToPath(String uri) {
Review Comment:
see above comment
##########
kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/io/URIContentLoaderFactory.java:
##########
@@ -85,25 +64,29 @@ public static byte[] readBytes(String uriStr, Workflow
workflow, ParserContext p
}
public static byte[] readBytes(String uriStr, Workflow workflow,
Optional<ParserContext> parserContext) {
- return readAllBytes(buildLoader(URI.create(uriStr), workflow,
parserContext, null));
+ return readAllBytes(buildLoader(uriStr, workflow, parserContext,
null));
}
public static Builder builder(URI uri) {
Review Comment:
This constructor seems unused anymore: maybe better to delete it ?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]