You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SpiTransport.java 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (C) 2012, GitHub Inc. and others
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the Eclipse Distribution License v. 1.0 which is available at
  6. * https://www.eclipse.org/org/documents/edl-v10.php.
  7. *
  8. * SPDX-License-Identifier: BSD-3-Clause
  9. */
  10. package org.eclipse.jgit.transport;
  11. import java.util.Collections;
  12. import java.util.Set;
  13. import org.eclipse.jgit.errors.NotSupportedException;
  14. import org.eclipse.jgit.errors.TransportException;
  15. import org.eclipse.jgit.lib.Repository;
  16. /**
  17. * Transport protocol contributed via service provider
  18. */
  19. public class SpiTransport extends Transport {
  20. /**
  21. * Transport protocol scheme
  22. */
  23. public static final String SCHEME = "testspi";
  24. /**
  25. * Instance
  26. */
  27. public static final TransportProtocol PROTO = new TransportProtocol() {
  28. @Override
  29. public String getName() {
  30. return "Test SPI Transport Protocol";
  31. }
  32. @Override
  33. public Set<String> getSchemes() {
  34. return Collections.singleton(SCHEME);
  35. }
  36. @Override
  37. public Transport open(URIish uri, Repository local, String remoteName)
  38. throws NotSupportedException, TransportException {
  39. throw new NotSupportedException("not supported");
  40. }
  41. };
  42. private SpiTransport(Repository local, URIish uri) {
  43. super(local, uri);
  44. }
  45. @Override
  46. public FetchConnection openFetch() throws NotSupportedException,
  47. TransportException {
  48. throw new NotSupportedException("not supported");
  49. }
  50. @Override
  51. public PushConnection openPush() throws NotSupportedException,
  52. TransportException {
  53. throw new NotSupportedException("not supported");
  54. }
  55. @Override
  56. public void close() {
  57. // Intentionally left blank
  58. }
  59. }