當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。