com.github.junrar.Archive.getFileHeaders()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(120)

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

Archive.getFileHeaders介绍

暂无

代码示例

代码示例来源:origin: mucommander/mucommander

public Collection<FileHeader> getEntries() {
  return archive.getFileHeaders();
}

代码示例来源:origin: uk.gov.nationalarchives/droid-core-interfaces

@Override
public void handle(IdentificationRequest request) throws IOException {
  if (request.getClass().isAssignableFrom(FileSystemIdentificationRequest.class)) {
    FileSystemIdentificationRequest req = (FileSystemIdentificationRequest) request;
    FileVolumeManager fileVolumeManager = new FileVolumeManager(req.getFile());
    try {
      try (Archive archive = new Archive(fileVolumeManager)) {
        if (archive.isEncrypted()) {
          throw new RuntimeException("Encrypted archive");
        }
        RarWalker walker = new RarWalker(archive, req.getIdentifier());
        walker.walk(archive.getFileHeaders());
      }
    } catch (RarException ex) {
      throw new RuntimeException("Rar procesing failed :", ex);
    }
  } else {
    log.info("Identification request for RAR archive ignored due to limited support.");
  }
}

代码示例来源:origin: mucommander/mucommander

public InputStream getEntryInputStream(String path) throws IOException, RarException {
  for (FileHeader h : archive.getFileHeaders()) {
    if (h.getFileNameString().equals(path)) {
      header1 = h;

代码示例来源:origin: digital-preservation/droid

@Override
public void handle(IdentificationRequest request) throws IOException {
  VolumeManager readerVolume = new RarReader(request.getWindowReader());
  try {
    try (Archive archive = new Archive(readerVolume)) {
      if (archive.isEncrypted()) {
        throw new RuntimeException("Encrypted archive");
      }
      RarWalker walker = new RarWalker(archive, request.getIdentifier());
      walker.walk(archive.getFileHeaders());
    }
  } catch (RarException ex) {
    throw new RuntimeException("Rar processing failed :", ex);
  }
}

代码示例来源:origin: digital-preservation/droid

/**
 * @param uri to identify
 * @param request identification request. Only FileSystemIdentificationRequest is supported.
 * @throws CommandExecutionException ex.
 */
public void identify(final URI uri, final IdentificationRequest request) throws CommandExecutionException {
  final String newPath = makeContainerURI("rar", request.getFileName());
  setSlash1("");
  if (request.getClass().isAssignableFrom(FileSystemIdentificationRequest.class)) {
    FileSystemIdentificationRequest req = (FileSystemIdentificationRequest) request;
    FileVolumeManager fileVolumeManager = new FileVolumeManager(req.getFile().toFile());
    try {
      try (Archive archive = new Archive(fileVolumeManager)) {
        if (archive.isEncrypted()) {
          log.info("encrypted rar");
        } else {
          for (FileHeader entry : archive.getFileHeaders()) {
            processEntry(entry, archive, uri, newPath);
          }
        }
      }
    } catch (IOException e) {
      throw new CommandExecutionException("IO error in RARFileSystem", e);
    } catch (RarException ex) {
      throw new CommandExecutionException("Rar exception in RARFileSystem", ex);
    }
  } else {
    log.info("Identification request for RAR archive ignored due to limited support.");
  }
}

代码示例来源:origin: edmund-wagner/junrar

for (final FileHeader header : archive.getFileHeaders()) {
  AbstractFileName name = (AbstractFileName) getFileSystemManager()
      .resolveName(

代码示例来源:origin: com.github.junrar/junrar

for (final FileHeader header : this.archive.getFileHeaders()) {
  final AbstractFileName name = (AbstractFileName) getFileSystemManager()
      .resolveName(

相关文章