You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "lahodaj (via GitHub)" <gi...@apache.org> on 2023/09/19 09:21:11 UTC
[GitHub] [netbeans] lahodaj commented on a diff in pull request #6466: The ClassLoader used to load annotation processors does not return directories from getResource/getResources methods, while normal ClassLoaders do - fixing.
lahodaj commented on code in PR #6466:
URL: https://github.com/apache/netbeans/pull/6466#discussion_r1329829466
##########
java/java.source.base/src/org/netbeans/modules/java/source/parsing/FileObjects.java:
##########
@@ -949,6 +949,34 @@ static Pair<String,List<URL>> parseModulePatches(@NonNull final Iterator<? exten
return null;
}
+ public static URI getZipPathURI(URI zipURI, String resourceName) {
+ try {
+ //Optimistic try and see
+ return new URI ("jar:"+zipURI.toString()+"!/"+resourceName); //NOI18N
+ } catch (URISyntaxException e) {
+ //Need to encode the resName part (slower)
+ final StringBuilder sb = new StringBuilder ();
+ final String[] elements = resourceName.split("/"); //NOI18N
+ try {
+ for (int i = 0; i< elements.length; i++) {
+ String element = elements[i];
+ element = URLEncoder.encode(element, "UTF-8"); //NOI18N
+ element = element.replace("+", "%20"); //NOI18N
Review Comment:
`URLEncoder.encode` apparently replaces spaces with `+`. So this merely undoes that.
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists