@Test public void createResourceURL() { URL url = this.urlFactory.createResourceURL("o;ne/t?w&o/t=hr#e e", false, this.oldcore.getXWikiContext()); assertEquals("http: Map<String, Object> queryParametersMap = new LinkedHashMap<>(); queryParametersMap.put("cache-version", "11.1-SNAPSHOT#"); queryParametersMap.put("anArrayOfInt", new int[] {42, 56}); queryParametersMap.put("aListWithStringToEncode", Arrays.asList("épervier", "androïde")); queryParametersMap.put("aCustomObject", new Object() { @Override public String toString() { return "foo"; } }); queryParametersMap.put("paramètre", new String[] {"foo", "bâr"}); url = this.urlFactory.createResourceURL("o;ne/t?w&o/t=hr#e e", false, this.oldcore.getXWikiContext(), queryParametersMap); assertEquals("http: + "&anArrayOfInt=42&anArrayOfInt=56" + "&aListWithStringToEncode=%C3%A9pervier&aListWithStringToEncode=andro%C3%AFde" + "&aCustomObject=foo" + "&param%C3%A8tre=foo&param%C3%A8tre=b%C3%A2r", url.toString()); }
@Override public URL createResourceURL(String filename, boolean forceSkinAction, XWikiContext context, Map<String, Object> queryParameters) { StringBuilder path = new StringBuilder(this.contextPath); if (forceSkinAction) { addServletPath(path, context.getWikiId(), context); addAction(path, null, "skin", context); } path.append("resources"); addFileName(path, filename, false, context); try { return buildURL(getServerURL(context), path.toString(), queryParameters, context); } catch (MalformedURLException e) { return null; } }
XWikiServletURLFactory extends XWikiDefaultURLFactory { @Override public URL createResourceURL(String filename, boolean forceSkinAction, XWikiContext context, Map<String, Object> queryParameters) { StringBuilder path = new StringBuilder(this.contextPath); if (forceSkinAction) { addServletPath(path, context.getWikiId(), context); addAction(path, null, "skin", context); } path.append("resources"); addFileName(path, filename, false, context); try { return buildURL(getServerURL(context), path.toString(), queryParameters, context); } catch (MalformedURLException e) { return null; } } }
XWikiServletURLFactory extends XWikiDefaultURLFactory { @Override public URL createResourceURL(String filename, boolean forceSkinAction, XWikiContext context, Map<String, Object> queryParameters) { StringBuilder path = new StringBuilder(this.contextPath); if (forceSkinAction) { addServletPath(path, context.getWikiId(), context); addAction(path, null, "skin", context); } path.append("resources"); addFileName(path, filename, false, context); try { return buildURL(getServerURL(context), path.toString(), queryParameters, context); } catch (MalformedURLException e) { return null; } } XWikiServletURLFactory();  XWikiServletURLFactory(URL defaultURL, String contextPath, String actionPath);  XWikiServletURLFactory(XWikiContext context); }
XWikiServletURLFactory extends XWikiDefaultURLFactory { @Override public URL createResourceURL(String filename, boolean forceSkinAction, XWikiContext context, Map<String, Object> queryParameters) { StringBuilder path = new StringBuilder(this.contextPath); if (forceSkinAction) { addServletPath(path, context.getWikiId(), context); addAction(path, null, "skin", context); } path.append("resources"); addFileName(path, filename, false, context); try { return buildURL(getServerURL(context), path.toString(), queryParameters, context); } catch (MalformedURLException e) { return null; } } XWikiServletURLFactory();  XWikiServletURLFactory(URL defaultURL, String contextPath, String actionPath);  XWikiServletURLFactory(XWikiContext context); @Override void init(XWikiContext context); void setDefaultURL(String wikiId, URL baseURL); String getContextPath(); @Override URL getServerURL(XWikiContext context); URL getServerURL(String wikiId, XWikiContext context); @Override URL createURL(String spaces, String name, String action, boolean redirect, XWikiContext context); @Override URL createURL(String spaces, String name, String action, String querystring, String anchor, String xwikidb,
        XWikiContext context); @Override URL createExternalURL(String spaces, String name, String action, String querystring, String anchor,
        String xwikidb, XWikiContext context); @Override URL createSkinURL(String filename, String skin, XWikiContext context, Map<String, Object> queryParameters); @Override URL createSkinURL(String filename, String spaces, String name, String xwikidb, XWikiContext context,
        Map<String, Object> queryParameters); @Override URL createResourceURL(String filename, boolean forceSkinAction, XWikiContext context,
        Map<String, Object> queryParameters); URL createTemplateURL(String fileName, XWikiContext context); @Override URL createAttachmentURL(String filename, String spaces, String name, String action, String querystring,
        String xwikidb, XWikiContext context); @Override URL createAttachmentRevisionURL(String filename, String spaces, String name, String revision,
        String querystring, String xwikidb, XWikiContext context); URL createAttachmentRevisionURL(String filename, String spaces, String name, String revision, long recycleId,
        String querystring, String xwikidb, XWikiContext context); @Override String getURL(URL url, XWikiContext context); @Override URL getRequestURL(XWikiContext context); XWikiAttachment findAttachmentForDocRevision(XWikiDocument doc, String docRevision, String filename,
        XWikiContext context); long findDeletedAttachmentForDocRevision(XWikiDocument doc, String docRevision, String filename,
        XWikiContext context); }
XWikiServletURLFactory extends XWikiDefaultURLFactory { @Override public URL createResourceURL(String filename, boolean forceSkinAction, XWikiContext context, Map<String, Object> queryParameters) { StringBuilder path = new StringBuilder(this.contextPath); if (forceSkinAction) { addServletPath(path, context.getWikiId(), context); addAction(path, null, "skin", context); } path.append("resources"); addFileName(path, filename, false, context); try { return buildURL(getServerURL(context), path.toString(), queryParameters, context); } catch (MalformedURLException e) { return null; } } XWikiServletURLFactory();  XWikiServletURLFactory(URL defaultURL, String contextPath, String actionPath);  XWikiServletURLFactory(XWikiContext context); @Override void init(XWikiContext context); void setDefaultURL(String wikiId, URL baseURL); String getContextPath(); @Override URL getServerURL(XWikiContext context); URL getServerURL(String wikiId, XWikiContext context); @Override URL createURL(String spaces, String name, String action, boolean redirect, XWikiContext context); @Override URL createURL(String spaces, String name, String action, String querystring, String anchor, String xwikidb,
        XWikiContext context); @Override URL createExternalURL(String spaces, String name, String action, String querystring, String anchor,
        String xwikidb, XWikiContext context); @Override URL createSkinURL(String filename, String skin, XWikiContext context, Map<String, Object> queryParameters); @Override URL createSkinURL(String filename, String spaces, String name, String xwikidb, XWikiContext context,
        Map<String, Object> queryParameters); @Override URL createResourceURL(String filename, boolean forceSkinAction, XWikiContext context,
        Map<String, Object> queryParameters); URL createTemplateURL(String fileName, XWikiContext context); @Override URL createAttachmentURL(String filename, String spaces, String name, String action, String querystring,
        String xwikidb, XWikiContext context); @Override URL createAttachmentRevisionURL(String filename, String spaces, String name, String revision,
        String querystring, String xwikidb, XWikiContext context); URL createAttachmentRevisionURL(String filename, String spaces, String name, String revision, long recycleId,
        String querystring, String xwikidb, XWikiContext context); @Override String getURL(URL url, XWikiContext context); @Override URL getRequestURL(XWikiContext context); XWikiAttachment findAttachmentForDocRevision(XWikiDocument doc, String docRevision, String filename,
        XWikiContext context); long findDeletedAttachmentForDocRevision(XWikiDocument doc, String docRevision, String filename,
        XWikiContext context);  }