gpt4 book ai didi

org.apache.commons.vfs2.provider.zip.ZipFileSystemConfigBuilder类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 09:56:17 26 4
gpt4 key购买 nike

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

ZipFileSystemConfigBuilder介绍

暂无

代码示例

代码示例来源:origin: apache/commons-vfs

/**
   * Return config builder.
   *
   * @return A config builder for ZipFileProvider.
   * @see org.apache.commons.vfs2.provider.AbstractFileProvider#getConfigBuilder()
   */
  @Override
  public FileSystemConfigBuilder getConfigBuilder() {
    return ZipFileSystemConfigBuilder.getInstance();
  }
}

代码示例来源:origin: apache/commons-vfs

public Charset getCharset(final FileSystemOptions opts) {
  return (Charset) getParam(opts, KEY_CHARSET);
}

代码示例来源:origin: apache/commons-vfs

public void setCharset(final FileSystemOptions opts, final Charset charset) {
  setParam(opts, KEY_CHARSET, charset);
}

代码示例来源:origin: apache/commons-vfs

/**
   * Returns the base folder for read tests.
   */
  @Override
  public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception {
    final FileSystemOptions opts = new FileSystemOptions();
    final ZipFileSystemConfigBuilder builder = ZipFileSystemConfigBuilder.getInstance();
    // Tests the same charset as the default but we exercise having a Charset set.
    builder.setCharset(opts, StandardCharsets.UTF_8);

    final File zipFile = AbstractVfsTestCase.getTestResource("test.zip");
    final String uri = "zip:file:" + zipFile.getAbsolutePath() + "!/";
    FileObject resolvedFile = manager.resolveFile(uri, opts);
    FileSystem fileSystem = resolvedFile.getFileSystem();
    Assert.assertTrue(fileSystem instanceof ZipFileSystem);
    ZipFileSystem zipFileSystem = (ZipFileSystem) fileSystem;
    Assert.assertEquals(StandardCharsets.UTF_8, zipFileSystem.getCharset());
    return resolvedFile;
  }
}

代码示例来源:origin: apache/commons-vfs

public ZipFileSystem(final AbstractFileName rootName, final FileObject parentLayer,
    final FileSystemOptions fileSystemOptions) throws FileSystemException {
  super(rootName, parentLayer, fileSystemOptions);
  
  // Make a local copy of the file
  file = parentLayer.getFileSystem().replicateFile(parentLayer, Selectors.SELECT_SELF);
  this.charset = ZipFileSystemConfigBuilder.getInstance().getCharset(fileSystemOptions);
  
  // Open the Zip file
  if (!file.exists()) {
    // Don't need to do anything
    zipFile = null;
    return;
  }
}

代码示例来源:origin: apache/commons-vfs

/**
   * Returns the base folder for read tests.
   */
  @Override
  public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception {
    final FileSystemOptions opts = new FileSystemOptions();
    final ZipFileSystemConfigBuilder builder = ZipFileSystemConfigBuilder.getInstance();
    // Tests null as the default.
    builder.setCharset(opts, null);

    final File zipFile = AbstractVfsTestCase.getTestResource("test.zip");
    final String uri = "zip:file:" + zipFile.getAbsolutePath() + "!/";
    FileObject resolvedFile = manager.resolveFile(uri, opts);
    FileSystem fileSystem = resolvedFile.getFileSystem();
    Assert.assertTrue(fileSystem instanceof ZipFileSystem);
    ZipFileSystem zipFileSystem = (ZipFileSystem) fileSystem;
    Assert.assertEquals(null, zipFileSystem.getCharset());
    return resolvedFile;
  }
}

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