Package com.xpn.xwiki.plugin.zipexplorer
Class ZipExplorerPlugin
- java.lang.Object
-
- com.xpn.xwiki.plugin.XWikiDefaultPlugin
-
- com.xpn.xwiki.plugin.zipexplorer.ZipExplorerPlugin
-
- All Implemented Interfaces:
XWikiPluginInterface
@Deprecated public class ZipExplorerPlugin extends XWikiDefaultPlugin
Deprecated.the plugin technology is deprecated, consider rewriting as componentsSeeZipExplorerPluginAPIfor documentation.- Version:
- $Id: defa012753771998e6eef257150f2a395958d84f $
-
-
Constructor Summary
Constructors Constructor Description ZipExplorerPlugin(String name, String className, XWikiContext context)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description XWikiAttachmentdownloadAttachment(XWikiAttachment attachment, XWikiContext context)Deprecated.For ZIP URLs of the formathttp://[...]/zipfile.zip/SomeDirectory/SomeFile.txtreturn a new attachment containing the file pointed to inside the ZIP.StringgetFileLink(Document document, String attachmentName, String fileName, XWikiContext context)Deprecated.List<String>getFileList(Document document, String attachmentName, XWikiContext context)Deprecated.protected StringgetFileLocationFromZipURL(String url, String action)Deprecated.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 ofListItemelements representing a tree view of all directories and files in the ZIP.StringgetName()Deprecated.ApigetPluginApi(XWikiPluginInterface plugin, XWikiContext context)Deprecated.protected booleanisValidZipURL(String url, String action)Deprecated.protected booleanisZipFile(InputStream filecontent)Deprecated.-
Methods inherited from class com.xpn.xwiki.plugin.XWikiDefaultPlugin
beginParsing, beginRendering, commonTagsHandler, endParsing, endRendering, endRenderingHandler, flushCache, flushCache, getClassName, getLocalization, init, insidePREHandler, localizePlainOrKey, outsidePREHandler, setClassName, setName, startRenderingHandler, virtualInit
-
-
-
-
Constructor Detail
-
ZipExplorerPlugin
public ZipExplorerPlugin(String name, String className, XWikiContext context)
Deprecated.- Parameters:
name- the plugin nameclassName- the plugin classname (used in logs for example)context- the XWiki Context- See Also:
XWikiDefaultPlugin(String,String,com.xpn.xwiki.XWikiContext)
-
-
Method Detail
-
getName
public String getName()
Deprecated.- Specified by:
getNamein interfaceXWikiPluginInterface- Overrides:
getNamein classXWikiDefaultPlugin
-
getPluginApi
public Api getPluginApi(XWikiPluginInterface plugin, XWikiContext context)
Deprecated.- Specified by:
getPluginApiin interfaceXWikiPluginInterface- Overrides:
getPluginApiin classXWikiDefaultPlugin
-
downloadAttachment
public XWikiAttachment downloadAttachment(XWikiAttachment attachment, XWikiContext context)
Deprecated.For ZIP URLs of the formathttp://[...]/zipfile.zip/SomeDirectory/SomeFile.txtreturn 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.- Specified by:
downloadAttachmentin interfaceXWikiPluginInterface- Overrides:
downloadAttachmentin classXWikiDefaultPlugin- Parameters:
attachment- the original attachmentcontext- the XWiki context, used to get the request URL corresponding to the download request- 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, XWikiContext context)
Deprecated.- Parameters:
document- the document containing the ZIP file as an attachmentattachmentName- the name under which the ZIP file is attached in the documentcontext- not used- Returns:
- the list of file entries in the ZIP file attached under the passed attachment name inside the passed document
- See Also:
ZipExplorerPluginAPI.getFileList(com.xpn.xwiki.api.Document, java.lang.String)
-
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 ofListItemelements representing a tree view of all directories and files in the ZIP. For example the following zip:
generates the following ListItem list:zipfile.zip: Directory/File.txt File2.txt{ 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 documentcontext- not used- Returns:
- a tree view list of
ListItemelements representing the content of the ZIP file - See Also:
ZipExplorerPluginAPI.getFileTreeList(com.xpn.xwiki.api.Document, java.lang.String)
-
getFileLink
public String getFileLink(Document document, String attachmentName, String fileName, XWikiContext context)
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 URLcontext- not used- Returns:
- the attachment URL of the passed attachment located in the passed document to which the passed filename has been suffixed.
- See Also:
ZipExplorerPluginAPI.getFileLink(com.xpn.xwiki.api.Document, java.lang.String, 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 locationaction- 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 returnSomeDirectory/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
-
-