Skip to content

fix error in entry type judgment#43

Open
kenvifire wants to merge 1 commit into
EvanOxfeld:masterfrom
kenvifire:master
Open

fix error in entry type judgment#43
kenvifire wants to merge 1 commit into
EvanOxfeld:masterfrom
kenvifire:master

Conversation

@kenvifire

Copy link
Copy Markdown

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

shannon commented Feb 14, 2014

Copy link
Copy Markdown

+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

sveisvei commented Mar 3, 2014

Copy link
Copy Markdown

+1 this.

@meuserj

meuserj commented Apr 17, 2014

Copy link
Copy Markdown

+1

@MathieuLoutre

Copy link
Copy Markdown

This fixed my problem as well.

@Ankurrana Ankurrana left a comment

Copy link
Copy Markdown

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