Details
-
Improvement
-
Resolution: Duplicate
-
Major
-
None
-
1.0 B1
-
None
Description
Right now there are URL factories in XWiki the problem is that they return URL objects which means that all parts of the code which need to manipulate the URL (like extract some portion of it) have to parse it. This is fastidious, prone to error and duplicates efforts.
Here's an example of what the ZipURLExplorer plugin does simply to get the URL portion after the document's name:
protected String getFileLocationFromZipURL(String url, String action) { String path = url.substring(url.indexOf("/" + action)); int pos = 0; for (int i = 0; i < 4; i++) { pos = path.indexOf("/", pos + 1); } if (pos == -1) { return ""; } return path.substring(pos + 1); }
This type of code can be found again in other places.
Attachments
Issue Links
- duplicates
-
XWIKI-3951 Replace oldcore Entity URL parsing by the new URL module
- Closed
-
XWIKI-2618 Introduce URL Resolver to parse URLs into its constituents
- Closed
- is related to
-
XWIKI-3926 The parent is not URL-encoded when rendering a link for a new page that doesn't exist
- Closed