blob: ff960e699839954aa17699cadab6818eb9774a42 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2007 Instantiations, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Instantiations, Inc. - initial API and implementation
* xored software, Inc. - Eclipse way
*******************************************************************************/
package org.eclipse.epp.installer.archive;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
public interface IArchive {
String getName();
Iterator entries();
/**
* Returns the archive file entry for the specified name, or null
* if not found.
*
* @param name the name of the entry
* @return the archive file entry, or null if not found
* @throws IllegalStateException if the archive file has been closed
*/
public IArchiveEntry getEntry(String name);
/**
* Returns an input stream for reading the contents of the specified
* archive file entry.
*
* <p> Closing this archive file will, in turn, close all input
* streams that have been returned by invocations of this method.
*
* @param entry the archive file entry
* @return the input stream for reading the contents of the specified
* archive file entry.
* @throws ArchiveException if an archive format error has occurred
* @throws IOException if an I/O error has occurred
* @throws IllegalStateException if the archive file has been closed
*/
public InputStream getInputStream(IArchiveEntry entry) throws IOException;
void close() throws IOException;
}