Class TempResourceAction

  • All Implemented Interfaces:
    com.xpn.xwiki.internal.web.LegacyAction

    @Component
    @Named("temp")
    @Singleton
    @Deprecated
    public class TempResourceAction
    extends XWikiAction
    Deprecated.
    Use the "tmp" resource reference handler instead since 8.3
    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:
    • (module): it's the 3rd path segment in the request URL (format: {code .../temp/1/2/3/4})
    • (wiki): the name of the current wiki (extracted from the URL too)
    • (space): it's the 1st path segment in the request URL (format: {code .../temp/1/2/3/4})
    • (page): it's the 2nd path segment in the request URL (format: {code .../temp/1/2/3/4})
    • (file): it's the 4th path segment in the request URL (format: {code .../temp/1/2/3/4})
    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: cf719c9124a2de2a8377a968f6ff08260b235d43 $
    • Field Detail

      • URI_PATTERN

        public static final Pattern URI_PATTERN
        Deprecated.
        URI pattern for this action.
    • Constructor Detail

      • TempResourceAction

        public TempResourceAction()
        Deprecated.
    • Method Detail

      • getTemporaryFile

        protected File getTemporaryFile​(String uri,
                                        XWikiContext context)
        Deprecated.
        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.