Package com.xpn.xwiki.plugin.zipexplorer
Class ZipExplorerPluginAPI
- java.lang.Object
-
- com.xpn.xwiki.api.Api
-
- com.xpn.xwiki.plugin.PluginApi<ZipExplorerPlugin>
-
- com.xpn.xwiki.plugin.zipexplorer.ZipExplorerPluginAPI
-
@Deprecated public class ZipExplorerPluginAPI extends PluginApi<ZipExplorerPlugin>
Deprecated.the plugin technology is deprecated, consider rewriting as componentsZIP-related APIs to list content of a ZIP attachments and to intercept XWiki download requests so that it's possible to display contents found inside ZIP files. This plugin accepts specially formatted URLs pointing to files inside ZIP files by using the following syntax:http://[...]/download/Document/zipfile.zip/SomeDirectory/SomeFile.txt
. In this example, the URL points to theSomeFile.txt
file located in a directory namedSomeDirectory
inside a ZIP file namedzipfile.zip
and attached to the document namedDocument
.- Version:
- $Id: 8bb7259b921a644b005f31f23ce248a1a651e7e3 $
- See Also:
ZipExplorerPlugin
-
-
Constructor Summary
Constructors Constructor Description ZipExplorerPluginAPI(ZipExplorerPlugin plugin, XWikiContext context)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description XWikiAttachment
downloadAttachment(XWikiAttachment attachment)
Deprecated.For ZIP URLs of the formathttp://[...]/zipfile.zip/SomeDirectory/SomeFile.txt
return a new attachment containing the file pointed to inside the ZIP.String
getFileLink(Document document, String attachmentName, String fileName)
Deprecated.List<String>
getFileList(Document document, String attachmentName)
Deprecated.List<ListItem>
getFileTreeList(Document document, String attachmentName)
Deprecated.Finds the ZIP attachment with passed name from the passed document matching and parse the ZIP to generate a list ofListItem
elements representing a tree view of all directories and files in the ZIP.-
Methods inherited from class com.xpn.xwiki.plugin.PluginApi
getInternalPlugin, getProtectedPlugin, setPlugin
-
Methods inherited from class com.xpn.xwiki.api.Api
convert, convert, convert, convertAttachments, getAuthorizationManager, getContextualAuthorizationManager, getXWikiContext, hasAccess, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights
-
-
-
-
Constructor Detail
-
ZipExplorerPluginAPI
public ZipExplorerPluginAPI(ZipExplorerPlugin plugin, XWikiContext context)
Deprecated.- Parameters:
plugin
- the ZIP Explorer plugin that this class is hiding.context
- the XWiki context instance containing the last user request
-
-
Method Detail
-
downloadAttachment
public XWikiAttachment downloadAttachment(XWikiAttachment attachment)
Deprecated.For ZIP URLs of the formathttp://[...]/zipfile.zip/SomeDirectory/SomeFile.txt
return a new attachment containing the file pointed to inside the ZIP. If the original attachment does not point to a ZIP file or if it doesn't specify a location inside the ZIP then do nothing and return the original attachment.- Parameters:
attachment
- the original attachment- Returns:
- a new attachment pointing to the file pointed to by the URL inside the ZIP or the original attachment if the requested URL doesn't specify a file inside a ZIP
- See Also:
XWikiDefaultPlugin.downloadAttachment(com.xpn.xwiki.doc.XWikiAttachment, com.xpn.xwiki.XWikiContext)
-
getFileList
public List<String> getFileList(Document document, String attachmentName)
Deprecated.- Parameters:
document
- the document containing the ZIP file as an attachmentattachmentName
- the name under which the ZIP file is attached in the document- Returns:
- the list of file entries in the ZIP file attached under the passed attachment name inside the passed document
-
getFileTreeList
public List<ListItem> getFileTreeList(Document document, String attachmentName)
Deprecated.Finds the ZIP attachment with passed name from the passed document matching and parse the ZIP to generate a list ofListItem
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 attachmentattachmentName
- the name under which the ZIP file is attached in the document- Returns:
- a tree view list of
ListItem
elements representing the content of the ZIP file
-
getFileLink
public String getFileLink(Document document, String attachmentName, String fileName)
Deprecated.- Parameters:
document
- the document containing the ZIP file as an attachmentattachmentName
- the name under which the ZIP file is attached in the documentfileName
- the filename to concatenate at the end of the attachment URL- Returns:
- the attachment URL of the passed attachment located in the passed document to which the passed filename has been suffixed.
-
-