[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    [jira] [Created] (COMPRESS-508) Bug: cannot get file size of ArchiveEntry using ZipArchiveInputStrea
From:       "AD_LB (Jira)" <jira () apache ! org>
Date:       2020-03-31 17:55:00
Message-ID: JIRA.13295320.1585677274000.35737.1585677300155 () Atlassian ! JIRA
[Download RAW message or body]

AD_LB created COMPRESS-508:
------------------------------

             Summary: Bug: cannot get file size of ArchiveEntry using \
ZipArchiveInputStream  Key: COMPRESS-508
                 URL: https://issues.apache.org/jira/browse/COMPRESS-508
             Project: Commons Compress
          Issue Type: Bug
          Components: Build
    Affects Versions: 1.20
         Environment: Android 9 and Android 10, on both emulator and real device .
            Reporter: AD_LB
         Attachments: 2020-03-31_20-53-36.png, ZipTest.zip

I'm trying to use  ZipArchiveInputStream to iterate over the items of a zip file \
(which may or may not be a real file on the file-system, which is why I use a \
stream), optionally creating a stream from specific entries.

One of the operations I need is to get the size of the files within.

For some reason, it fails to do so. Not only that, but it throws an exception when \
I'm done with it:


Error:org.apache.commons.compress.archivers.zip.UnsupportedZipFeatureException: \
Unsupported feature data descriptor used in entry ...

Here's the relevant code (kotlin) :

  
{code:java}
        thread {
            try {
                val file = File("/storage/emulated/0/test.zip")
                ZipArchiveInputStream(FileInputStream(file)).use {
                    while (true) {
                        val entry = it.nextEntry ?: break
                        Log.d("AppLog", "entry:${entry.name} ${entry.size} ")
                    }
                }
                Log.d("AppLog", "got archive ")
            } catch (e: Exception) {
                Log.d("AppLog", "Error:$e")
                e.printStackTrace()
            }
        }
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic