Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f31cba41 authored by Diksha Gohlyan's avatar Diksha Gohlyan Committed by Automerger Merge Worker
Browse files

Merge "If size of file equals zero, still compress" into mainline-prod am: beeb194d

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/DocumentsUI/+/12466206

Change-Id: I27ace47aa0314d85c18bbddc8e87cb2a9fdb56f5
parents 0eb55b42 beeb194d
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -20,16 +20,16 @@ import android.text.TextUtils;

import androidx.annotation.NonNull;

import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;

import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.ArchiveInputStream;
import org.apache.commons.compress.archivers.sevenz.SevenZFile;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipFile;

import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;

/**
 * To simulate the input stream by using ZipFile, SevenZFile, or ArchiveInputStream.
 */
@@ -124,7 +124,7 @@ abstract class ArchiveEntryInputStream extends InputStream {
            throw new IllegalArgumentException("ArchiveEntry is empty");
        }

        if (archiveEntry.isDirectory() || archiveEntry.getSize() <= 0
        if (archiveEntry.isDirectory() || archiveEntry.getSize() < 0
                || TextUtils.isEmpty(archiveEntry.getName())) {
            throw new IllegalArgumentException("ArchiveEntry is an invalid file entry");
        }