-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add archiver (fixes #87) #89
Conversation
ZipEntry dirZipEntry = new ZipEntry(relativePath+'/'); | ||
// Setting this bit explicitly is needed by some unzipping applications (see JENKINS-3294). | ||
dirZipEntry.setExternalAttributes(BITMASK_IS_DIRECTORY); | ||
//if (mode!=-1) dirZipEntry.setUnixMode(mode); // TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
@Override | ||
public void visit(final File f, final String _relativePath) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public Archiver create(OutputStream out) throws IOException { | ||
return new TrueZipArchiver(out); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
@Override | ||
public void visit(final File f, final String _relativePath) throws IOException { | ||
// int mode = IOUtils.mode(f); // TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zip.closeEntry(); | ||
} else { | ||
ZipEntry fileZipEntry = new ZipEntry(relativePath); | ||
//if (mode!=-1) fileZipEntry.setUnixMode(mode); // TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
entriesWritten++; | ||
} | ||
|
||
public void close() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the "@OverRide" annotation above this method signature
} | ||
|
||
// Bitmask indicating directories in 'external attributes' of a ZIP archive entry. | ||
private static final long BITMASK_IS_DIRECTORY = 1<<4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Bitmask indicating directories in 'external attributes' of a ZIP archive entry. | ||
private static final long BITMASK_IS_DIRECTORY = 1<<4; | ||
|
||
public static final ArchiverFactory FACTORY = new Factory(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SonarQube analysis reported 11 issues: Watch the comments in this conversation to review them. |
No description provided.