public class FileSystemURLFactory extends XWikiServletURLFactory
file://
links, and not as http://
links.contextPath, serverURL
Constructor and Description |
---|
FileSystemURLFactory() |
Modifier and Type | Method and Description |
---|---|
URL |
createAttachmentRevisionURL(String filename,
String space,
String name,
String revision,
String wiki,
XWikiContext context) |
URL |
createAttachmentURL(String filename,
String space,
String name,
String action,
String querystring,
String wiki,
XWikiContext context) |
URL |
createResourceURL(String filename,
boolean forceSkinAction,
XWikiContext context) |
URL |
createSkinURL(String filename,
String skin,
XWikiContext context) |
String |
getURL(URL url,
XWikiContext context)
Converts a URL to a relative URL if it's a XWiki URL (keeping only the path + query string + anchor) and leave
the URL unchanged if it's an external URL.
|
addFileName, addFileName, createAttachmentRevisionURL, createAttachmentRevisionURL, createExternalURL, createSkinURL, createTemplateURL, createURL, createURL, findAttachmentForDocRevision, findDeletedAttachmentForDocRevision, getContextPath, getRequestURL, getServerURL, getServerURL, init, isContextDoc, normalizeURL, normalizeURL
createAttachmentRevisionURL, createAttachmentURL, createExternalURL, createSkinURL, createURL, createURL, createURL
public URL createAttachmentURL(String filename, String space, String name, String action, String querystring, String wiki, XWikiContext context)
createAttachmentURL
in interface XWikiURLFactory
createAttachmentURL
in class XWikiServletURLFactory
public URL createAttachmentRevisionURL(String filename, String space, String name, String revision, String wiki, XWikiContext context)
createAttachmentRevisionURL
in interface XWikiURLFactory
createAttachmentRevisionURL
in class XWikiDefaultURLFactory
public URL createSkinURL(String filename, String skin, XWikiContext context)
createSkinURL
in interface XWikiURLFactory
createSkinURL
in class XWikiServletURLFactory
public URL createResourceURL(String filename, boolean forceSkinAction, XWikiContext context)
createResourceURL
in interface XWikiURLFactory
createResourceURL
in class XWikiServletURLFactory
public String getURL(URL url, XWikiContext context)
An URL is considered to be external if its server component doesn't match the server of the current request URL. This means that URLs are made relative with respect to the current request URL rather than the current wiki set on the XWiki context. Let's take an example:
request URL: http://playground.xwiki.org/xwiki/bin/view/Sandbox/TestURL
current wiki: code (code.xwiki.org)
URL (1): http://code.xwiki.org/xwiki/bin/view/Main/WebHome
URL (2): http://playground.xwiki.org/xwiki/bin/view/Spage/Page
The result will be:
(1) http://code.xwiki.org/xwiki/bin/view/Main/WebHome
(2) /xwiki/bin/view/Spage/Page
getURL
in interface XWikiURLFactory
getURL
in class XWikiServletURLFactory
url
- the URL to convertXWikiDefaultURLFactory.getURL(java.net.URL, com.xpn.xwiki.XWikiContext)
Copyright © 2004–2014 XWiki. All rights reserved.