Search in sources :

Example 1 with Bzip2Decompressor

use of com.amaze.filemanager.filesystem.compressed.showcontents.helpers.Bzip2Decompressor in project AmazeFileManager by TeamAmaze.

the class CompressedHelper method getCompressorInstance.

/**
 * To add compatibility with other compressed file types edit this method
 */
public static Decompressor getCompressorInstance(@NonNull Context context, @NonNull File file) {
    Decompressor decompressor;
    String type = getExtension(file.getPath());
    if (isZip(type)) {
        decompressor = new ZipDecompressor(context);
    } else if (isRar(type)) {
        decompressor = new RarDecompressor(context);
    } else if (isTar(type)) {
        decompressor = new TarDecompressor(context);
    } else if (isGzippedTar(type)) {
        decompressor = new GzipDecompressor(context);
    } else if (isBzippedTar(type)) {
        decompressor = new Bzip2Decompressor(context);
    } else if (isXzippedTar(type)) {
        decompressor = new XzDecompressor(context);
    } else if (isLzippedTar(type)) {
        decompressor = new LzmaDecompressor(context);
    } else if (is7zip(type)) {
        decompressor = new SevenZipDecompressor(context);
    } else {
        return null;
    }
    decompressor.setFilePath(file.getPath());
    return decompressor;
}
Also used : LzmaDecompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.LzmaDecompressor) RarDecompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.RarDecompressor) SevenZipDecompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.SevenZipDecompressor) Bzip2Decompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.Bzip2Decompressor) TarDecompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.TarDecompressor) XzDecompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.XzDecompressor) ZipDecompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.ZipDecompressor) GzipDecompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.GzipDecompressor) Decompressor(com.amaze.filemanager.filesystem.compressed.showcontents.Decompressor) SevenZipDecompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.SevenZipDecompressor) ZipDecompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.ZipDecompressor) GzipDecompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.GzipDecompressor) RarDecompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.RarDecompressor) Bzip2Decompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.Bzip2Decompressor) XzDecompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.XzDecompressor) TarDecompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.TarDecompressor) SevenZipDecompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.SevenZipDecompressor) LzmaDecompressor(com.amaze.filemanager.filesystem.compressed.showcontents.helpers.LzmaDecompressor)

Aggregations

Decompressor (com.amaze.filemanager.filesystem.compressed.showcontents.Decompressor)1 Bzip2Decompressor (com.amaze.filemanager.filesystem.compressed.showcontents.helpers.Bzip2Decompressor)1 GzipDecompressor (com.amaze.filemanager.filesystem.compressed.showcontents.helpers.GzipDecompressor)1 LzmaDecompressor (com.amaze.filemanager.filesystem.compressed.showcontents.helpers.LzmaDecompressor)1 RarDecompressor (com.amaze.filemanager.filesystem.compressed.showcontents.helpers.RarDecompressor)1 SevenZipDecompressor (com.amaze.filemanager.filesystem.compressed.showcontents.helpers.SevenZipDecompressor)1 TarDecompressor (com.amaze.filemanager.filesystem.compressed.showcontents.helpers.TarDecompressor)1 XzDecompressor (com.amaze.filemanager.filesystem.compressed.showcontents.helpers.XzDecompressor)1 ZipDecompressor (com.amaze.filemanager.filesystem.compressed.showcontents.helpers.ZipDecompressor)1