本文整理了Java中org.apache.wicket.util.resource.ZipResourceStream
类的一些代码示例,展示了ZipResourceStream
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipResourceStream
类的具体详情如下:
包路径:org.apache.wicket.util.resource.ZipResourceStream
类名称:ZipResourceStream
[英]An IResourceStream that ZIPs a directory's contents on the fly
NOTE 1. As a future improvement, cache a map of generated ZIP files for every directory and use a Watcher to detect modifications in this directory. Using ehcache would be good for that, but it's not in Wicket dependencies yet. No caching of the generated ZIP files is done yet.
NOTE 2. As a future improvement, implement getLastModified() and request ResourceStreamRequestTarget to generate Last-Modified and Expires HTTP headers. No HTTP cache headers are provided yet. See WICKET-385
[中]一个IResourceStream,可以动态压缩目录的内容
注1。作为未来的改进,为每个目录缓存生成的ZIP文件的映射,并使用监视程序检测该目录中的修改。使用ehcache会有好处,但它还不在Wicket依赖中。尚未对生成的ZIP文件进行缓存。
注2。作为未来的改进,实现getLastModified()和请求ResourceStreamRequestTarget以生成Last Modified和Expires HTTP头。尚未提供HTTP缓存头。见WICKET-385
代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service
/**
* Construct.
*
* @param dir
* The directory where to look for files. The directory itself will not be included
* in the ZIP.
* @param recursive
* If true, all subdirs will be zipped as well
*/
public ZipResourceStream(final File dir, final boolean recursive)
{
if ((dir == null) || !dir.isDirectory())
{
throw new IllegalArgumentException("Not a directory: " + dir);
}
bytearray = new ByteArrayOutputStream();
try
{
ZipOutputStream out = new ZipOutputStream(bytearray);
zipDir(dir, out, "", recursive);
}
catch (Exception e)
{
throw new WicketRuntimeException(e);
}
}
代码示例来源:origin: org.apache.wicket/wicket-util
try
zipDir(dir, out, "", recursive);
} finally {
out.close();
代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service
zipDir(f, out, path + f.getName() + "/", recursive);
代码示例来源:origin: org.apache.wicket/wicket-util
zipDir(f, out, path + f.getName() + "/", recursive);
内容来源于网络,如有侵权,请联系作者删除!