1
2
3
4
5
6
7
8
9
10 package org.eclipse.jgit.transport;
11
12 import java.util.Collections;
13 import java.util.Set;
14
15 import org.eclipse.jgit.errors.NotSupportedException;
16 import org.eclipse.jgit.errors.TransportException;
17 import org.eclipse.jgit.lib.Repository;
18
19
20
21
22 public class SpiTransport extends Transport {
23
24
25
26
27 public static final String SCHEME = "testspi";
28
29
30
31
32 public static final TransportProtocol PROTO = new TransportProtocol() {
33
34 @Override
35 public String getName() {
36 return "Test SPI Transport Protocol";
37 }
38
39 @Override
40 public Set<String> getSchemes() {
41 return Collections.singleton(SCHEME);
42 }
43
44 @Override
45 public Transport open(URIish uri, Repository local, String remoteName)
46 throws NotSupportedException, TransportException {
47 throw new NotSupportedException("not supported");
48 }
49 };
50
51 private SpiTransport(Repository local, URIish uri) {
52 super(local, uri);
53 }
54
55 @Override
56 public FetchConnection openFetch() throws NotSupportedException,
57 TransportException {
58 throw new NotSupportedException("not supported");
59 }
60
61 @Override
62 public PushConnection openPush() throws NotSupportedException,
63 TransportException {
64 throw new NotSupportedException("not supported");
65 }
66
67 @Override
68 public void close() {
69
70 }
71 }