use of com.amaze.filemanager.filesystem.compressed.showcontents.helpers.SevenZipDecompressor 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;
}
Aggregations