diff options
author | David Ostrovsky <david@ostrovsky.org> | 2015-02-15 20:31:29 +0100 |
---|---|---|
committer | David Ostrovsky <david@ostrovsky.org> | 2015-02-20 01:40:06 +0100 |
commit | c0c4c6f09ac1d601a5d9fe9855e36e4b96b10335 (patch) | |
tree | ca02a75898d38203c510efef4037553e597691b4 /org.eclipse.jgit/.classpath | |
parent | 6c1f7393882baf8464859136a70199ea96fcae0f (diff) | |
download | jgit-c0c4c6f09ac1d601a5d9fe9855e36e4b96b10335.tar.gz jgit-c0c4c6f09ac1d601a5d9fe9855e36e4b96b10335.zip |
ArchiveCommand: Allow to pass options to underlying stream
Current ArchiveCommand design doesn't allow to pass in options to
underlying stream implementations. To overcome this, client has to
implement custom format implementation (it cannot be derived from
the existing one, because the classes are marked as final), and set
the options using ThreadLocal, before the method
ArchiveOutputStream createArchiveOutputStream(OutputStream s)
is get called.
This change extends the ArchiveCommand.Format by allowing to pass
option map during creation of ArchiveOutputStream.
ArchiveCommand is extended correspondingly. That way client can
easily pass options to the underlying streams:
Map<String, Object> level = ImmutableMap.<String, Object> of(
"level", new Integer(9));
new ArchiveCommand(repo)
.setFormat("zip")
.setFormatOptions(level)
.setTree(tree)
.setPaths(paths)
.setPrefix(prefix)
.setOutputStream(sidebandOut)
.call();
Change-Id: I1d92a1e5249117487da39d19c7593e4b812ad97a
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
Diffstat (limited to 'org.eclipse.jgit/.classpath')
0 files changed, 0 insertions, 0 deletions