gpt4 book ai didi

net.lingala.zip4j.model.ZipParameters.setFileNameInZip()方法的使用及代码示例

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

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

ZipParameters.setFileNameInZip介绍

暂无

代码示例

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

ZipParameters zp = new ZipParameters();
zp.setFileNameInZip("sample.zip");
System.out.println(zp.getCompressionMethod());
System.out.println(Zip4jConstants.COMP_DEFLATE);

OutPut:
8
8

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

public void EmployeeEncyrptedZipFileDownload(HttpServletResponse response, @RequestParam(value = "id", required = true) int employeeId) throws IOException, ZipException
{
  //Prepare text file contents
  String fileContent = "Hallo Welt";

  response.setContentType("application/zip");
  response.setHeader("Content-Disposition", "attachment;filename=test.zip");

  final StringBuilder sb = new StringBuilder(fileContent);
  final ZipOutputStream zout = new ZipOutputStream(response.getOutputStream());

  ZipParameters zipParameters = new ZipParameters();
  zipParameters.setSourceExternalStream(true);
  zipParameters.setFileNameInZip("mytext.txt");

  zout.putNextEntry(null, zipParameters);
  byte[] data = sb.toString().getBytes();
  zout.write(data, 0, data.length);

  zout.closeEntry();
  zout.finish();
}

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

zipParams.setPassword(pass);
zipParams.setSourceExternalStream(true);
zipParams.setFileNameInZip(fileName);

代码示例来源:origin: io.macgyver/macgyver-core

zp.setFileNameInZip(it.getName().replace(".",
                "/") + ".class");
            z.addStream(new ByteArrayInputStream(b), zp);
zp.setFileNameInZip("collected-cli-classes.jar");

代码示例来源:origin: com.tomitribe.tribestream/tribestream-container

if (content.files != null) {
  for (final File f : content.files) {
    parameters.setFileNameInZip(f.getName()); // drop the name
    zip.addFile(f, parameters);
    try (final InputStream stream = new ByteArrayInputStream(c.content)) {
      parameters.setSourceExternalStream(true);
      parameters.setFileNameInZip(c.name);
      zip.addStream(stream, parameters);
    } catch (final IOException e) { // more than unlikely

代码示例来源:origin: MCMrARM/revolution-irc

params.setFileNameInZip(BACKUP_PREFERENCES_PATH);
zipFile.addStream(exportPreferencesToJson(context), params);
  params.setFileNameInZip(BACKUP_PREF_VALUES_PREFIX + f.getName());
  zipFile.addFile(f, params);
  writer = new StringWriter();
  SettingsHelper.getGson().toJson(data, writer);
  params.setFileNameInZip(BACKUP_SERVER_PREFIX + data.uuid + BACKUP_SERVER_SUFFIX);
  zipFile.addStream(new ByteArrayInputStream(writer.toString().getBytes()), params);
  File sslCertsFile = configManager.getServerSSLCertsFile(data.uuid);
  if (sslCertsFile.exists()) {
    synchronized (ServerCertificateManager.get(sslCertsFile)) { // lock the helper to prevent any writes to the file
      params.setFileNameInZip(BACKUP_SERVER_CERTS_PREFIX + data.uuid + BACKUP_SERVER_CERTS_SUFFIX);
      zipFile.addFile(sslCertsFile, params);
params.setFileNameInZip(BACKUP_NOTIFICATION_RULES_PATH);
zipFile.addStream(new ByteArrayInputStream(writer.toString().getBytes()), params);
params.setFileNameInZip(BACKUP_COMMAND_ALIASES_PATH);
zipFile.addStream(new ByteArrayInputStream(writer.toString().getBytes()), params);
params.setFileNameInZip(NOTIFICATION_COUNT_DB_PATH);
zipFile.addFile(NotificationCountStorage.getFile(context), params);
NotificationCountStorage.getInstance(context).open();
  params.setFileNameInZip(BACKUP_THEME_PREFIX + themeInfo.uuid + BACKUP_THEME_SUFFIX);
  zipFile.addFile(themeManager.getThemePath(themeInfo.uuid), params);

代码示例来源:origin: org.jboss.forge.addon/resources-impl

parameters.setFileNameInZip(name);
if (resource instanceof DirectoryResource)

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