本文整理了Java中aQute.lib.zip.ZipUtil.getModifiedTime()
方法的一些代码示例,展示了ZipUtil.getModifiedTime()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipUtil.getModifiedTime()
方法的具体详情如下:
包路径:aQute.lib.zip.ZipUtil
类名称:ZipUtil
方法名:getModifiedTime
暂无
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
@Override
public long lastModified() {
if (lastModified != -11L) {
return lastModified;
}
return lastModified = ZipUtil.getModifiedTime(entry);
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
@Override
public long lastModified() {
if (lastModified != -11L) {
return lastModified;
}
return lastModified = ZipUtil.getModifiedTime(entry);
}
代码示例来源:origin: biz.aQute.bnd/bnd
public long lastModified() {
try {
if (lastModified == -11L) {
lastModified = ZipUtil.getModifiedTime(entry);
}
return lastModified;
}
catch (IOException e) {
return lastModified = -1;
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
public long lastModified() {
try {
if (lastModified == -11L) {
lastModified = ZipUtil.getModifiedTime(entry);
}
return lastModified;
}
catch (IOException e) {
return lastModified = -1;
}
}
代码示例来源:origin: biz.aQute.bnd/bnd
void unzip(InputStream in, File dir) throws Exception {
try {
JarInputStream jin = new JarInputStream(in);
JarEntry jentry = jin.getNextJarEntry();
while (jentry != null) {
if (!jentry.isDirectory()) {
File dest = Processor.getFile(dir, jentry.getName());
long modifiedTime = ZipUtil.getModifiedTime(jentry);
if (!dest.isFile() || dest.lastModified() < modifiedTime || modifiedTime <= 0) {
File dp = dest.getParentFile();
if (!dp.exists() && !dp.mkdirs()) {
throw new IOException("Could not create directory " + dp);
}
FileOutputStream out = new FileOutputStream(dest);
try {
copy(jin, out);
}
finally {
out.close();
}
}
}
jentry = jin.getNextJarEntry();
}
}
finally {
in.close();
}
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
void unzip(InputStream in, File dir) throws Exception {
try {
JarInputStream jin = new JarInputStream(in);
JarEntry jentry = jin.getNextJarEntry();
while (jentry != null) {
if (!jentry.isDirectory()) {
File dest = Processor.getFile(dir, jentry.getName());
long modifiedTime = ZipUtil.getModifiedTime(jentry);
if (!dest.isFile() || dest.lastModified() < modifiedTime || modifiedTime <= 0) {
File dp = dest.getParentFile();
if (!dp.exists() && !dp.mkdirs()) {
throw new IOException("Could not create directory " + dp);
}
FileOutputStream out = new FileOutputStream(dest);
try {
copy(jin, out);
}
finally {
out.close();
}
}
}
jentry = jin.getNextJarEntry();
}
}
finally {
in.close();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!