com.xpn.xwiki.web
Class TempResourceAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by com.xpn.xwiki.web.XWikiAction
          extended by com.xpn.xwiki.web.TempResourceAction

public class TempResourceAction
extends XWikiAction

Action responsible for downloading temporary resources created by various modules. The temporary resource is put in the temporary directory in a directory named "temp" and in subdirectories "(module)/(wiki)/(space)/(page)/(file)" where:

For example if the URL is http://localhost:8080/xwiki/bin/temp/Main/WebHome/test/test.png then the resource will be fetched from TMPDIR/temp/test/xwiki/Main/WebHome/test.png.

Since:
2.4M1
Version:
$Id: 66758b4eab32a383550f4aaf0b0510fa8e93b429 $

Field Summary
static Pattern URI_PATTERN
          URI pattern for this action.
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
TempResourceAction()
           
 
Method Summary
protected  File getTemporaryFile(String uri, XWikiContext context)
          Returns the temporary file corresponding to the specified URI.
 String render(XWikiContext context)
           
 
Methods inherited from class com.xpn.xwiki.web.XWikiAction
action, cleanupComponents, csrfTokenCheck, execute, execute, getRealPath, getTranslatedDocument, handleRevision, initializeContainerComponent, initializeXWikiContext, sendGlobalRedirect, sendRedirect
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URI_PATTERN

public static final Pattern URI_PATTERN
URI pattern for this action.

Constructor Detail

TempResourceAction

public TempResourceAction()
Method Detail

render

public String render(XWikiContext context)
              throws XWikiException
Overrides:
render in class XWikiAction
Throws:
XWikiException

getTemporaryFile

protected File getTemporaryFile(String uri,
                                XWikiContext context)
Returns the temporary file corresponding to the specified URI.

Parameters:
uri - request URI.
context - xwiki context.
Returns:
temporary file corresponding to the specified URI or null if no such file can be located.


Copyright © 2004-2013 XWiki. All Rights Reserved.