本文整理了Java中org.seasar.kvasir.util.io.impl.ZipReaderResource
类的一些代码示例,展示了ZipReaderResource
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipReaderResource
类的具体详情如下:
包路径:org.seasar.kvasir.util.io.impl.ZipReaderResource
类名称:ZipReaderResource
[英]ZIP形式で圧縮されているファイルを読み込むためのResource実装です。
注意:
このクラスは指定されたZIPファイルをクローズしません。 ZIPファイルの作成元の責任でZIPファイルをクローズして下さい。
同期化: このクラスはスレッドセーフです。
[中]
代码示例来源:origin: org.seasar.kvasir/kvasir-util
public Resource getParentResource()
{
if (path_.length() == 0) {
return null;
} else {
int slash = path_.lastIndexOf('/');
if (slash >= 0) {
return new ZipReaderResource(file_,
path_.substring(0, slash), entryMap_);
} else {
return new ZipReaderResource(file_, "", entryMap_);
}
}
}
代码示例来源:origin: org.seasar.kvasir/kvasir-util
public long getLastModifiedTime()
{
if (!exists_) {
return 0L;
} else if (path_.length() == 0) {
return 0L;
} else {
long time = getEntry().getTime();
if (time == -1) {
time = 0L;
}
return time;
}
}
代码示例来源:origin: org.seasar.kvasir/kvasir-util
public Resource[] listResources()
{
if (!exists_ || !directory_) {
return null;
}
Map map = getDescendantEntryMap();
List list = new ArrayList();
int pathOffset = (path_.length() == 0) ? 0 : path_.length() + 1;
for (Iterator itr = map.keySet().iterator(); itr.hasNext();) {
String path = (String)itr.next();
if (path.endsWith("/")) {
path = path.substring(0, path.length() - 1);
}
String subPath = path.substring(pathOffset);
if (subPath.indexOf('/') < 0) {
list.add(new ZipReaderResource(file_, path, entryMap_));
}
}
return (Resource[])list.toArray(new Resource[0]);
}
代码示例来源:origin: org.seasar.kvasir/kvasir-util
public String[] list()
{
if (!exists_ || !directory_) {
return null;
}
Map map = getDescendantEntryMap();
List list = new ArrayList();
int pathOffset = (path_.length() == 0) ? 0 : path_.length() + 1;
for (Iterator itr = map.keySet().iterator(); itr.hasNext();) {
String path = (String)itr.next();
if (path.endsWith("/")) {
path = path.substring(0, path.length() - 1);
}
String subPath = path.substring(pathOffset);
if (subPath.indexOf('/') < 0) {
list.add(subPath);
}
}
return (String[])list.toArray(new String[0]);
}
代码示例来源:origin: org.seasar.kvasir/kvasir-util
public Resource getChildResource(String child)
{
if (child.startsWith("/")) {
child = child.substring(1);
}
if (child.endsWith("/")) {
child = child.substring(0, child.length() - 1);
}
return new ZipReaderResource(file_, spath_ + child, entryMap_);
}
代码示例来源:origin: org.seasar.kvasir/kvasir-util
public long getSize()
{
if (!exists_) {
return 0L;
} else if (path_.length() == 0) {
return 0L;
} else {
long size = getEntry().getSize();
if (size == -1) {
size = 0L;
}
return size;
}
}
代码示例来源:origin: org.seasar.kvasir/kvasir-system
private void extractPluginArtifactTo(final Artifact artifact,
final Resource pluginsDir)
throws ZipException, IOException
{
final File file = artifact.getFile();
final ZipFile zipFile = new ZipFile(file);
try {
final ZipReaderResource zipReaderResource = new ZipReaderResource(
zipFile);
ResourceUtils.copy(zipReaderResource, pluginsDir);
} finally {
zipFile.close();
}
}
代码示例来源:origin: org.seasar.kvasir.cms.manage/org.seasar.kvasir.cms.manage
zipFile = new ZipFile(tempFile);
pagePlugin_.imports(getPage(), name_.trim(),
new ZipReaderResource(zipFile));
return true;
} catch (IOException ex) {
内容来源于网络,如有侵权,请联系作者删除!