本文整理了Java中java.util.zip.ZipFile.getComment()
方法的一些代码示例,展示了ZipFile.getComment()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipFile.getComment()
方法的具体详情如下:
包路径:java.util.zip.ZipFile
类名称:ZipFile
方法名:getComment
[英]Returns this file's comment, or null if it doesn't have one. See ZipOutputStream#setComment.
[中]返回此文件的注释,如果没有注释,则返回null。请参见ZipoutStream#setComment。
代码示例来源:origin: linghaolu/apkcomment
String comment = zipFile.getComment();
代码示例来源:origin: ujmp/universal-java-matrix-package
public ZipFileMatrix(File file) throws ZipException, IOException {
// must be this charset, otherwise a strange exception will occur
this.zipFile = new ZipFile(file, Charset.forName("Cp437"));
setLabel(zipFile.getName());
setMetaData("Comment", zipFile.getComment());
}
代码示例来源:origin: open-eid/digidoc4j
@Override
protected void parseContainer() {
logger.debug("Parsing zip file");
try {
String zipFileComment = zipFile.getComment();
setZipFileComment(zipFileComment);
parseZipFileManifest();
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry zipEntry = entries.nextElement();
parseEntry(zipEntry);
}
} finally {
IOUtils.closeQuietly(zipFile);
}
}
代码示例来源:origin: LiqiNew/MyUtils
try {
zf = new ZipFile(new File(zipFilePath));
byte[] bytes = zf.getComment().getBytes("GB2312");
byteToString = new String(bytes, "8859_1");
} catch (IOException e) {
代码示例来源:origin: jtransc/jtransc
ZipFile zipFile = new ZipFile(tmpfile);
System.out.println(normalizePath(zipFile.getName()));
System.out.println(zipFile.getComment());
System.out.println(zipFile.getEntry("hello.txt"));
JTranscConsole.log("[d]");
代码示例来源:origin: stackoverflow.com
Files.newOutputStream(newZipFilePath)))) {
String comment = oldZipFile.getComment();
if (comment != null) {
newZipFile.setComment(comment);
内容来源于网络,如有侵权,请联系作者删除!