gpt4 book ai didi

org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.setCreateUnicodeExtraFields()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 18:42:40 26 4
gpt4 key购买 nike

本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.setCreateUnicodeExtraFields()方法的一些代码示例,展示了ZipArchiveOutputStream.setCreateUnicodeExtraFields()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipArchiveOutputStream.setCreateUnicodeExtraFields()方法的具体详情如下:
包路径:org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream
类名称:ZipArchiveOutputStream
方法名:setCreateUnicodeExtraFields

ZipArchiveOutputStream.setCreateUnicodeExtraFields介绍

[英]Whether to create Unicode Extra Fields.

Defaults to NEVER.
[中]是否创建Unicode额外字段。
默认为从不。

代码示例

代码示例来源:origin: stackoverflow.com

ZipArchiveOutputStream ostream = ...; // Your initialization code here
ostream.setEncoding("Cp437"); // This should handle your "special" characters
ostream.setFallbackToUTF8(true); // For "unknown" characters!
ostream.setUseLanguageEncodingFlag(true);                               
ostream.setCreateUnicodeExtraFields(
  ZipArchiveOutputStream.UnicodeExtraFieldPolicy.NOT_ENCODEABLE);

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

new ZipArchiveOutputStream( bufferedOutputStream( fileOutputStream( zipFile, "zip" ) ) );
zipArchiveOutputStream.setEncoding( encoding );
zipArchiveOutputStream.setCreateUnicodeExtraFields( this.getUnicodeExtraFieldPolicy() );
zipArchiveOutputStream.setMethod(
  doCompress ? ZipArchiveOutputStream.DEFLATED : ZipArchiveOutputStream.STORED );

代码示例来源:origin: wso2-attic/esb-connectors

fos));
zaos.setEncoding("UTF-8");
zaos.setCreateUnicodeExtraFields(ZipArchiveOutputStream.UnicodeExtraFieldPolicy.ALWAYS);

代码示例来源:origin: org.alfresco/alfresco-repository

@Override
public void start(final ExporterContext context)
{
  zipStream = new ZipArchiveOutputStream(outputStream);
  // NOTE: This encoding allows us to workaround bug...
  //       http://bugs.sun.com/bugdatabase/view_bug.do;:WuuT?bug_id=4820807
  zipStream.setEncoding("UTF-8");
  zipStream.setCreateUnicodeExtraFields(UnicodeExtraFieldPolicy.ALWAYS);
  zipStream.setUseLanguageEncodingFlag(true);
  zipStream.setFallbackToUTF8(true);
}

代码示例来源:origin: Alfresco/alfresco-repository

@Override
public void start(final ExporterContext context)
{
  zipStream = new ZipArchiveOutputStream(outputStream);
  // NOTE: This encoding allows us to workaround bug...
  //       http://bugs.sun.com/bugdatabase/view_bug.do;:WuuT?bug_id=4820807
  zipStream.setEncoding("UTF-8");
  zipStream.setCreateUnicodeExtraFields(UnicodeExtraFieldPolicy.ALWAYS);
  zipStream.setUseLanguageEncodingFlag(true);
  zipStream.setFallbackToUTF8(true);
}

代码示例来源:origin: Alfresco/alfresco-repository

public void startExport()
{
  // ALF-2016
  zipStream = new ZipArchiveOutputStream(outputStream);
  // NOTE: This encoding allows us to workaround bug...
  //       http://bugs.sun.com/bugdatabase/view_bug.do;:WuuT?bug_id=4820807
  zipStream.setEncoding("UTF-8");
  zipStream.setCreateUnicodeExtraFields(UnicodeExtraFieldPolicy.ALWAYS);
  zipStream.setUseLanguageEncodingFlag(true);
  zipStream.setFallbackToUTF8(true);
  zipStream.setUseZip64(Zip64Mode.Always);
}

代码示例来源:origin: org.alfresco/alfresco-repository

public void startExport()
{
  // ALF-2016
  zipStream = new ZipArchiveOutputStream(outputStream);
  // NOTE: This encoding allows us to workaround bug...
  //       http://bugs.sun.com/bugdatabase/view_bug.do;:WuuT?bug_id=4820807
  zipStream.setEncoding("UTF-8");
  zipStream.setCreateUnicodeExtraFields(UnicodeExtraFieldPolicy.ALWAYS);
  zipStream.setUseLanguageEncodingFlag(true);
  zipStream.setFallbackToUTF8(true);
  zipStream.setUseZip64(Zip64Mode.Always);
}

代码示例来源:origin: org.apache.ant/ant-compress

private void configure(ZipArchiveOutputStream o) {
  o.setLevel(level);
  o.setComment(comment);
  o.setFallbackToUTF8(fallBackToUTF8);
  o.setUseLanguageEncodingFlag(useLanguageEncodingFlag);
  o.setCreateUnicodeExtraFields(createUnicodeExtraFields.getPolicy());
  o.setUseZip64(zip64Mode.getPolicy());
}

代码示例来源:origin: stackoverflow.com

import java.io.*;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
public class ZipFiles {  
  public static void main(String[] args) throws Exception{
    ZipArchiveOutputStream zipOut = new ZipArchiveOutputStream(new FileOutputStream("测试.zip"));
    zipOut.setEncoding("Cp437"); // This should handle your "special" characters
    zipOut.setFallbackToUTF8(true); // For "unknown" characters!
    zipOut.setUseLanguageEncodingFlag(true);                               
    zipOut.setCreateUnicodeExtraFields(
    ZipArchiveOutputStream.UnicodeExtraFieldPolicy.NOT_ENCODEABLE);
    zipOut.putArchiveEntry(new ZipArchiveEntry("测试.xml"));
    zipOut.putArchiveEntry(new ZipArchiveEntry("test.xml"));
    zipOut.closeArchiveEntry();
    zipOut.flush();
    zipOut.close();
  }
}

代码示例来源:origin: osmlab/atlas

zout.setCreateUnicodeExtraFields(
    ZipArchiveOutputStream.UnicodeExtraFieldPolicy.NOT_ENCODEABLE);
return new Archiver(zout);

代码示例来源:origin: org.xwiki.platform/xwiki-platform-filter-stream-xar

this.zipStream.setCreateUnicodeExtraFields(ZipArchiveOutputStream.UnicodeExtraFieldPolicy.ALWAYS);

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com