class DefaultArchiveExtractor implements ArchiveExtractor {

    @Override
    public void extract(File archiveFile, File destinationDirectory)
            throws ArchiveExtractionException {
        try {
            if (archiveFile.getAbsolutePath().endsWith("msi")) {
                extractMSIArchive(archiveFile, destinationDirectory);
            } else if (archiveFile.getAbsolutePath().endsWith("zip")) {
                extractZipArchive(archiveFile, destinationDirectory);
            } else {
                extractGzipTarArchive(archiveFile, destinationDirectory);
            }
        } catch (IOException e) {
            throw new ArchiveExtractionException(
                    "Could not extract archive: '" + archiveFile + "'", e);
        }
    }

}