Class ZipExplorerPlugin

    • Method Detail

      • getFileTreeList

        public List<ListItem> getFileTreeList​(Document document,
                                              String attachmentName,
                                              XWikiContext context)
        Deprecated.
        Finds the ZIP attachment with passed name from the passed document matching and parse the ZIP to generate a list of ListItem elements representing a tree view of all directories and files in the ZIP. For example the following zip:
        
         zipfile.zip:
           Directory/File.txt
           File2.txt
         
        generates the following ListItem list:
        
           { id = "Directory/", value = "Directory", parent = ""}
           { id = "Directory/File.txt", value = "File.txt", parent = "Directory/"}
           { id = "File2.txt", value = "File2.txt", parent = ""}
         
        Parameters:
        document - the document containing the ZIP file as an attachment
        attachmentName - the name under which the ZIP file is attached in the document
        context - not used
        Returns:
        a tree view list of ListItem elements representing the content of the ZIP file
        See Also:
        ZipExplorerPluginAPI.getFileTreeList(com.xpn.xwiki.api.Document, java.lang.String)
      • getFileLocationFromZipURL

        protected String getFileLocationFromZipURL​(String url,
                                                   String action)
        Deprecated.
        Parameters:
        url - the URL to parse and from which to extract the relative file location
        action - the XWiki requested action (for example "download", "edit", "view", etc).
        Returns:
        the relative file location of a file in the ZIP file pointed to by the passed URL. The ZIP URL must be of the format http://[...]/zipfile.zip/SomeDirectory/SomeFile.txt. With the example above this method would return SomeDirectory/SomeFile.txt. Return an empty string if the zip URL passed doesn't point inside a zip file.
      • isZipFile

        protected boolean isZipFile​(InputStream filecontent)
        Deprecated.
        Parameters:
        filecontent - the content of the file
        Returns:
        true if the file is in zip format (.zip, .jar etc) or false otherwise
      • isValidZipURL

        protected boolean isValidZipURL​(String url,
                                        String action)
        Deprecated.
        Parameters:
        url - the ZIP URL to check
        action - the XWiki requested action (for example "download", "edit", "view", etc).
        Returns:
        true if the ZIP URL points to a file inside the ZIP or false otherwise