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: [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]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists