gpt4 book ai didi

com.xpn.xwiki.plugin.zipexplorer.ZipExplorerPluginAPI类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 10:31:30 27 4
gpt4 key购买 nike

本文整理了Java中com.xpn.xwiki.plugin.zipexplorer.ZipExplorerPluginAPI类的一些代码示例,展示了ZipExplorerPluginAPI类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipExplorerPluginAPI类的具体详情如下:
包路径:com.xpn.xwiki.plugin.zipexplorer.ZipExplorerPluginAPI
类名称:ZipExplorerPluginAPI

ZipExplorerPluginAPI介绍

[英]ZIP-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 the SomeFile.txt file located in a directory named SomeDirectory inside a ZIP file named zipfile.zip and attached to the document named Document.
[中]与ZIP相关的API,用于列出ZIP附件的内容,并拦截XWiki下载请求,以便能够显示ZIP文件中的内容。该插件使用以下语法接受指向ZIP文件中文件的特殊格式URL:[$0$]。在本例中,URL指向名为zipfile.zip的ZIP文件中名为SomeDirectory的目录中的SomeFile.txt文件,并附加到名为Document的文档中。

代码示例

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

/**
 * {@inheritDoc}
 * 
 * @see com.xpn.xwiki.plugin.XWikiDefaultPlugin#getPluginApi
 */
@Override
public Api getPluginApi(XWikiPluginInterface plugin, XWikiContext context)
{
  return new ZipExplorerPluginAPI((ZipExplorerPlugin) plugin, context);
}

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

/**
   * @param document the document containing the ZIP file as an attachment
   * @param attachmentName the name under which the ZIP file is attached in the document
   * @param fileName the filename to concatenate at the end of the attachment URL
   * @return the attachment URL of the passed attachment located in the passed document to which the passed filename
   *         has been suffixed.
   */
  public String getFileLink(Document document, String attachmentName, String fileName)
  {
    return getProtectedPlugin().getFileLink(document, attachmentName, fileName, getXWikiContext());
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-zipexplorer

/**
 * @param document the document containing the ZIP file as an attachment
 * @param attachmentName the name under which the ZIP file is attached in the document
 * @return the list of file entries in the ZIP file attached under the passed attachment name inside the passed
 *         document
 */
public List<String> getFileList(Document document, String attachmentName)
{
  return getProtectedPlugin().getFileList(document, attachmentName, getXWikiContext());
}

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

/**
 * @param document the document containing the ZIP file as an attachment
 * @param attachmentName the name under which the ZIP file is attached in the document
 * @return the list of file entries in the ZIP file attached under the passed attachment name inside the passed
 *         document
 */
public List<String> getFileList(Document document, String attachmentName)
{
  return getProtectedPlugin().getFileList(document, attachmentName, getXWikiContext());
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-zipexplorer

@Override
public Api getPluginApi(XWikiPluginInterface plugin, XWikiContext context)
{
  return new ZipExplorerPluginAPI((ZipExplorerPlugin) plugin, context);
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-zipexplorer

/**
   * @param document the document containing the ZIP file as an attachment
   * @param attachmentName the name under which the ZIP file is attached in the document
   * @param fileName the filename to concatenate at the end of the attachment URL
   * @return the attachment URL of the passed attachment located in the passed document to which the passed filename
   *         has been suffixed.
   */
  public String getFileLink(Document document, String attachmentName, String fileName)
  {
    return getProtectedPlugin().getFileLink(document, attachmentName, fileName, getXWikiContext());
  }
}

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

/**
 * For ZIP URLs of the format <code>http://[...]/zipfile.zip/SomeDirectory/SomeFile.txt</code> 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.
 * 
 * @param attachment the original attachment
 * @return 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 com.xpn.xwiki.plugin.XWikiDefaultPlugin#downloadAttachment
 */
public XWikiAttachment downloadAttachment(XWikiAttachment attachment)
{
  return getProtectedPlugin().downloadAttachment(attachment, getXWikiContext());
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-zipexplorer

/**
 * For ZIP URLs of the format <code>http://[...]/zipfile.zip/SomeDirectory/SomeFile.txt</code> 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.
 * 
 * @param attachment the original attachment
 * @return 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 com.xpn.xwiki.plugin.XWikiDefaultPlugin#downloadAttachment
 */
public XWikiAttachment downloadAttachment(XWikiAttachment attachment)
{
  return getProtectedPlugin().downloadAttachment(attachment, getXWikiContext());
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-zipexplorer

/**
 * Finds the ZIP attachment with passed name from the passed document matching and parse the ZIP to generate a list
 * of {@link com.xpn.xwiki.objects.classes.ListItem} elements representing a tree view of all directories and files
 * in the ZIP. For example the following zip:
 * 
 * <pre>
 * zipfile.zip:
 *   Directory/File.txt
 *   File2.txt
 * </pre>
 * 
 * generates the following ListItem list:
 * 
 * <pre>
 * 
 *   { id = &quot;Directory/&quot;, value = &quot;Directory&quot;, parent = &quot;&quot;}
 *   { id = &quot;Directory/File.txt&quot;, value = &quot;File.txt&quot;, parent = &quot;Directory/&quot;}
 *   { id = &quot;File2.txt&quot;, value = &quot;File2.txt&quot;, parent = &quot;&quot;}
 * 
 * </pre>
 * 
 * @param document the document containing the ZIP file as an attachment
 * @param attachmentName the name under which the ZIP file is attached in the document
 * @return a tree view list of {@link com.xpn.xwiki.objects.classes.ListItem} elements representing the content of
 *         the ZIP file
 */
public List<ListItem> getFileTreeList(Document document, String attachmentName)
{
  return getProtectedPlugin().getFileTreeList(document, attachmentName, getXWikiContext());
}

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

/**
 * Finds the ZIP attachment with passed name from the passed document matching and parse the ZIP to generate a list
 * of {@link com.xpn.xwiki.objects.classes.ListItem} elements representing a tree view of all directories and files
 * in the ZIP. For example the following zip:
 * 
 * <pre>
 * zipfile.zip:
 *   Directory/File.txt
 *   File2.txt
 * </pre>
 * 
 * generates the following ListItem list:
 * 
 * <pre>
 * 
 *   { id = &quot;Directory/&quot;, value = &quot;Directory&quot;, parent = &quot;&quot;}
 *   { id = &quot;Directory/File.txt&quot;, value = &quot;File.txt&quot;, parent = &quot;Directory/&quot;}
 *   { id = &quot;File2.txt&quot;, value = &quot;File2.txt&quot;, parent = &quot;&quot;}
 * 
 * </pre>
 * 
 * @param document the document containing the ZIP file as an attachment
 * @param attachmentName the name under which the ZIP file is attached in the document
 * @return a tree view list of {@link com.xpn.xwiki.objects.classes.ListItem} elements representing the content of
 *         the ZIP file
 */
public List<ListItem> getFileTreeList(Document document, String attachmentName)
{
  return getProtectedPlugin().getFileTreeList(document, attachmentName, getXWikiContext());
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com