Class VfsScriptService

  • All Implemented Interfaces:
    org.xwiki.script.service.ScriptService

    @Component
    @Named("vfs")
    @Singleton
    public class VfsScriptService
    extends Object
    implements org.xwiki.script.service.ScriptService
    Offers scripting APIs for the VFS module.
    Since:
    7.4M2
    Version:
    $Id: 06865ebd9e495e1bdc2d86b1506aa8604334a0db $
    • Constructor Detail

      • VfsScriptService

        public VfsScriptService()
    • Method Detail

      • url

        public String url​(VfsResourceReference reference)
        Generate a relative VFS URL to access a resource inside an archive.
        Parameters:
        reference - the reference to a file inside a an archive. For example attach:space.page@my.zip/path/to/file.
        Returns:
        a relative URL that can be used to access the content of a file inside an archive (ZIP, EAR, TAR.GZ, etc) or null if the URL couldn't be constructed
      • url

        public String url​(VfsResourceReference reference,
                          String contentType)
        Generate a relative VFS URL to access a resource inside an archive.
        Parameters:
        reference - the reference to a file inside a an archive. For example attach:space.page@my.zip/path/to/file.
        contentType - the Content-Type to return with the response
        Returns:
        a relative URL that can be used to access the content of a file inside an archive (ZIP, EAR, TAR.GZ, etc) or null if the URL couldn't be constructed
        Since:
        12.3RC1