ArchiveFactory

Inheritance: java.lang.Object

public final class ArchiveFactory

Detects the archive format and creates the appropriate IArchive object according to the type of archive.

Methods

MethodDescription
getArchive(InputStream stream)Detects the archive format and creates the appropriate IArchive object according to the type of archive specified by the given stream.
getArchive(String path)Detects the archive format and creates the appropriate IArchive object according to the type of archive specified by the given path.

getArchive(InputStream stream)

public static IArchive getArchive(InputStream stream)

Detects the archive format and creates the appropriate IArchive object according to the type of archive specified by the given stream.

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamThe stream containing the archive data. It must bee seekable.

Returns: IArchive - An IArchive object representing the archive.

getArchive(String path)

public static IArchive getArchive(String path)

Detects the archive format and creates the appropriate IArchive object according to the type of archive specified by the given path.

Parameters:

ParameterTypeDescription
pathjava.lang.StringThe path to the archive to be analyzed.

Returns: IArchive - An IArchive object representing the archive.