|
|
@ -115,7 +115,7 @@ class Archive extends TextBuiltin { |
|
|
|
public enum Format { |
|
|
|
public enum Format { |
|
|
|
ZIP, |
|
|
|
ZIP, |
|
|
|
TAR |
|
|
|
TAR |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static interface Archiver { |
|
|
|
private static interface Archiver { |
|
|
|
ArchiveOutputStream createArchiveOutputStream(OutputStream s); |
|
|
|
ArchiveOutputStream createArchiveOutputStream(OutputStream s); |
|
|
@ -137,13 +137,14 @@ class Archive extends TextBuiltin { |
|
|
|
throws IOException { |
|
|
|
throws IOException { |
|
|
|
final ZipArchiveEntry entry = new ZipArchiveEntry(path); |
|
|
|
final ZipArchiveEntry entry = new ZipArchiveEntry(path); |
|
|
|
|
|
|
|
|
|
|
|
if (mode == FileMode.REGULAR_FILE) |
|
|
|
if (mode == FileMode.REGULAR_FILE) { |
|
|
|
; // ok
|
|
|
|
// ok
|
|
|
|
else if (mode == FileMode.EXECUTABLE_FILE || |
|
|
|
} else if (mode == FileMode.EXECUTABLE_FILE |
|
|
|
mode == FileMode.SYMLINK) |
|
|
|
|| mode == FileMode.SYMLINK) { |
|
|
|
entry.setUnixMode(mode.getBits()); |
|
|
|
entry.setUnixMode(mode.getBits()); |
|
|
|
else |
|
|
|
} else { |
|
|
|
warnArchiveEntryModeIgnored(path); |
|
|
|
warnArchiveEntryModeIgnored(path); |
|
|
|
|
|
|
|
} |
|
|
|
entry.setSize(loader.getSize()); |
|
|
|
entry.setSize(loader.getSize()); |
|
|
|
out.putArchiveEntry(entry); |
|
|
|
out.putArchiveEntry(entry); |
|
|
|
loader.copyTo(out); |
|
|
|
loader.copyTo(out); |
|
|
@ -162,7 +163,7 @@ class Archive extends TextBuiltin { |
|
|
|
final TarArchiveEntry entry = new TarArchiveEntry( //
|
|
|
|
final TarArchiveEntry entry = new TarArchiveEntry( //
|
|
|
|
path, TarConstants.LF_SYMLINK); |
|
|
|
path, TarConstants.LF_SYMLINK); |
|
|
|
entry.setLinkName(new String( //
|
|
|
|
entry.setLinkName(new String( //
|
|
|
|
loader.getCachedBytes(100), "UTF-8")); |
|
|
|
loader.getCachedBytes(100), "UTF-8")); //$NON-NLS-1$
|
|
|
|
out.putArchiveEntry(entry); |
|
|
|
out.putArchiveEntry(entry); |
|
|
|
out.closeArchiveEntry(); |
|
|
|
out.closeArchiveEntry(); |
|
|
|
return; |
|
|
|
return; |
|
|
|