当前位置: 首页>>代码示例>>Java>>正文


Java ZipOutputStream.setComment方法代码示例

本文整理汇总了Java中java.util.zip.ZipOutputStream.setComment方法的典型用法代码示例。如果您正苦于以下问题:Java ZipOutputStream.setComment方法的具体用法?Java ZipOutputStream.setComment怎么用?Java ZipOutputStream.setComment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.zip.ZipOutputStream的用法示例。


在下文中一共展示了ZipOutputStream.setComment方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createBugReport

import java.util.zip.ZipOutputStream; //导入方法依赖的package包/类
public static void createBugReport(File reportFile, Throwable exception, String userMessage, Process process,
		String logMessage, File[] attachments) throws IOException {
	ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(reportFile));
	zipOut.setComment("RapidMiner bug report - generated " + new Date());
	write("message.txt", "User message", userMessage, zipOut);
	write("_process.xml", "Process as in memory.", process.getRootOperator().getXML(false), zipOut);
	if (process.getProcessLocation() != null) {
		try {
			String contents = process.getProcessLocation().getRawXML();
			write(process.getProcessLocation().getShortName(), "Raw process file in repository.", contents, zipOut);
		} catch (Throwable t) {
			write(process.getProcessLocation().getShortName(), "Raw process file in repository.",
					"could not read: " + t, zipOut);
		}
	}
	write("_log.txt", "Log message", logMessage, zipOut);
	write("_properties.txt", "System properties, information about java version and operating system", getProperties(),
			zipOut);
	write("_exception.txt", "Exception stack trace", getStackTrace(exception), zipOut);

	for (File attachment : attachments) {
		writeFile(attachment, zipOut);
	}
	zipOut.close();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:26,代码来源:BugReport.java

示例2: zipFiles

import java.util.zip.ZipOutputStream; //导入方法依赖的package包/类
public static void zipFiles(Collection<File> resFileList, File zipFile, String comment) throws IOException {
    ZipOutputStream zipout = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile), 1048576));
    for (File resFile : resFileList) {
        zipFile(resFile, zipout, "");
    }
    zipout.setComment(comment);
    zipout.close();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:9,代码来源:ZipUtils.java

示例3: zipFiles

import java.util.zip.ZipOutputStream; //导入方法依赖的package包/类
/**
 * 批量压缩文件(夹)
 *
 * @param resFileList 要压缩的文件(夹)列表
 * @param zipFile 生成的压缩文件
 * @param comment 压缩文件的注释
 * @throws IOException 当压缩过程出错时抛出
 */
public static void zipFiles(Collection<File> resFileList, File zipFile, String comment)
        throws IOException {
    ZipOutputStream zipout = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(
            zipFile), BUFF_SIZE));
    for (File resFile : resFileList) {
        zipFile(resFile, zipout, "");
    }
    zipout.setComment(comment);
    zipout.close();
}
 
开发者ID:Evan-Galvin,项目名称:FreeStreams-TVLauncher,代码行数:19,代码来源:ZipUtil.java

示例4: zipFiles

import java.util.zip.ZipOutputStream; //导入方法依赖的package包/类
/**
 * 批量压缩文件(夹)
 *
 * @param resFileList 要压缩的文件(夹)列表
 * @param zipFile     生成的压缩文件
 * @param comment     压缩文件的注释
 * @throws IOException 当压缩过程出错时抛出
 */
public static void zipFiles(Collection<File> resFileList, File zipFile, String comment)
        throws IOException {
    ZipOutputStream zipout = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(
            zipFile), BUFF_SIZE));
    for (File resFile : resFileList) {
        zipFile(resFile, zipout, "");
    }
    zipout.setComment(comment);
    zipout.close();
}
 
开发者ID:tututututututu,项目名称:BaseCore,代码行数:19,代码来源:ZipUtils.java

示例5: writeToZIPComment

import java.util.zip.ZipOutputStream; //导入方法依赖的package包/类
private static String writeToZIPComment(ZipOutputStream zip, String customer, String key) {
    zip.setComment(AES.encrypt("WMID: " + customer, key));
    System.out.println("Injected encrypted customer name into zip comment");
    return "Injected encrypted customer name into zip comment";
}
 
开发者ID:ItzSomebody,项目名称:Simple-JAR-Watermark,代码行数:6,代码来源:Injector.java


注:本文中的java.util.zip.ZipOutputStream.setComment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。