* ArchiveOutputStream out = format.createArchiveOutputStream(System.out);
* try {
* for (...) {
- * format.putEntry(path, mode, repo.open(objectId), out);
+ * format.putEntry(out, path, mode, repo.open(objectId));
* }
* } finally {
* out.close();
*/
public static interface Format {
ArchiveOutputStream createArchiveOutputStream(OutputStream s);
- void putEntry(String path, FileMode mode, //
- ObjectLoader loader, ArchiveOutputStream out) //
- throws IOException;
+ void putEntry(ArchiveOutputStream out, String path, FileMode mode,
+ ObjectLoader loader) throws IOException;
}
/**
continue;
walk.getObjectId(idBuf, 0);
- fmt.putEntry(name, mode, reader.open(idBuf), outa);
+ fmt.putEntry(outa, name, mode, reader.open(idBuf));
}
} finally {
outa.close();
return new TarArchiveOutputStream(s);
}
- public void putEntry(String path, FileMode mode, ObjectLoader loader,
- ArchiveOutputStream out) throws IOException {
+ public void putEntry(ArchiveOutputStream out,
+ String path, FileMode mode, ObjectLoader loader)
+ throws IOException {
if (mode == FileMode.SYMLINK) {
final TarArchiveEntry entry = new TarArchiveEntry(
path, TarConstants.LF_SYMLINK);
return new ZipArchiveOutputStream(s);
}
- public void putEntry(String path, FileMode mode, ObjectLoader loader,
- ArchiveOutputStream out) throws IOException {
+ public void putEntry(ArchiveOutputStream out,
+ String path, FileMode mode, ObjectLoader loader)
+ throws IOException {
final ZipArchiveEntry entry = new ZipArchiveEntry(path);
if (mode == FileMode.REGULAR_FILE) {