本文整理了Java中com.xpn.xwiki.plugin.zipexplorer.ZipExplorerPlugin.isZipFile()
方法的一些代码示例,展示了ZipExplorerPlugin.isZipFile()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipExplorerPlugin.isZipFile()
方法的具体详情如下:
包路径:com.xpn.xwiki.plugin.zipexplorer.ZipExplorerPlugin
类名称:ZipExplorerPlugin
方法名:isZipFile
暂无
代码示例来源: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 context not used
* @return the list of file entries in the ZIP file attached under the passed attachment name inside the passed
* document
* @see com.xpn.xwiki.plugin.zipexplorer.ZipExplorerPluginAPI#getFileList
*/
public List<String> getFileList(Document document, String attachmentName, XWikiContext context)
{
List<String> zipList = new ArrayList<String>();
Attachment attachment = document.getAttachment(attachmentName);
try {
byte[] stream = attachment.getContent();
ByteArrayInputStream bais = new ByteArrayInputStream(stream);
if (isZipFile(bais)) {
ZipInputStream zis = new ZipInputStream(bais);
ZipEntry entry;
while ((entry = zis.getNextEntry()) != null) {
zipList.add(entry.getName());
}
}
} catch (XWikiException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return zipList;
}
代码示例来源: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 context not used
* @return the list of file entries in the ZIP file attached under the passed attachment name inside the passed
* document
* @see com.xpn.xwiki.plugin.zipexplorer.ZipExplorerPluginAPI#getFileList
*/
public List<String> getFileList(Document document, String attachmentName, XWikiContext context)
{
List<String> zipList = new ArrayList<String>();
Attachment attachment = document.getAttachment(attachmentName);
InputStream stream = null;
try {
stream = new ByteArrayInputStream(attachment.getContent());
if (isZipFile(stream)) {
ZipInputStream zis = new ZipInputStream(stream);
ZipEntry entry;
while ((entry = zis.getNextEntry()) != null) {
zipList.add(entry.getName());
}
}
} catch (XWikiException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return zipList;
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
if (!isZipFile(attachment.getContentInputStream(context))) {
return attachment;
代码示例来源:origin: org.xwiki.platform/xwiki-platform-zipexplorer
stream = new BufferedInputStream(attachment.getContentInputStream(context));
if (!isZipFile(stream)) {
return attachment;
内容来源于网络,如有侵权,请联系作者删除!