1
2
3
4
5
6
7
8
9
10 package org.eclipse.jgit.archive;
11
12 import java.util.ArrayList;
13 import java.util.List;
14
15 import org.eclipse.jgit.api.ArchiveCommand;
16
17
18
19
20
21
22
23
24 public class ArchiveFormats {
25 private static final List<String> myFormats = new ArrayList<>();
26
27 private static final void register(String name, ArchiveCommand.Format<?> fmt) {
28 myFormats.add(name);
29 ArchiveCommand.registerFormat(name, fmt);
30 }
31
32
33
34
35
36
37
38 public static void registerAll() {
39 register("tar", new TarFormat());
40 register("tgz", new TgzFormat());
41 register("tbz2", new Tbz2Format());
42 register("txz", new TxzFormat());
43 register("zip", new ZipFormat());
44 }
45
46
47
48
49
50
51
52 public static void unregisterAll() {
53 for (String name : myFormats) {
54 ArchiveCommand.unregisterFormat(name);
55 }
56 myFormats.clear();
57 }
58 }