Ejemplo n.º 1
0
  @Override
  public synchronized ArchiveEntryIterator getEntryIterator()
      throws IOException, UnsupportedFileOperationException {
    try {
      checkRarFile();
    } catch (RarException e) {
      throw new IOException();
    }

    Vector<ArchiveEntry> entries = new Vector<ArchiveEntry>();
    for (Object o : rarFile.getEntries()) entries.add(createArchiveEntry((FileHeader) o));

    return new WrapperArchiveEntryIterator(entries.iterator());
  }
Ejemplo n.º 2
0
  @Override
  public synchronized InputStream getEntryInputStream(
      ArchiveEntry entry, ArchiveEntryIterator entryIterator)
      throws IOException, UnsupportedFileOperationException {
    try {
      checkRarFile();
    } catch (RarException e) {
      throw new IOException();
    }

    try {
      return rarFile.getEntryInputStream(entry.getPath().replace('/', '\\'));
    } catch (RarException e) {
      throw new IOException();
    }
  }