Skip to content

Conversation

@kenvifire
Copy link

There is no need to test compressedSize is 0 or not, just to check if the file name ends with '/'.
Following is the code snippet from Java SDK ( java.util.ZipEntry)

/**
* Returns true if this is a directory entry. A directory entry is
* defined to be one whose name ends with a '/'.
* @return true if this is a directory entry
*/
public boolean isDirectory() {
return name.endsWith("/");
}

@shannon
Copy link

shannon commented Feb 14, 2014

+1 this. I ran into an issue today with a zip file created on Chrome OS. For some odd reason the compressed size of the directories is 2 not 0 so it fails this check which then cause an error when it tries to write the children of that directory.

{
"error": "EEXIST, mkdir '/tmp/models'"
}

@sveisvei
Copy link

sveisvei commented Mar 3, 2014

+1 this.

@meuserj
Copy link

meuserj commented Apr 17, 2014

+1

@MathieuLoutre
Copy link

This fixed my problem as well.

Copy link

@Ankurrana Ankurrana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes my problem as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants