aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blewitt2010-06-03 19:38:50 (EDT)
committerAlex Blewitt2010-06-03 19:38:50 (EDT)
commit046d1a2ef6ddea2a9521ac49ae339e05c1cc0acd (patch)
tree8cf3db9cfad386eb530ca80f05726832757ddbb7
parentd8ec8527a6de4ad557e3064e24c8f2e34b3e7932 (diff)
downloadjgit-046d1a2ef6ddea2a9521ac49ae339e05c1cc0acd.zip
jgit-046d1a2ef6ddea2a9521ac49ae339e05c1cc0acd.tar.gz
jgit-046d1a2ef6ddea2a9521ac49ae339e05c1cc0acd.tar.bz2
Provide a public entry method to determine whether a URI protocol is supportedrefs/changes/03/803/1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java
index c0b2eed..2fe3cb9 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java
@@ -319,6 +319,38 @@ public abstract class Transport {
}
/**
+ * Determines whether the transport can handle the given URIish.
+ *
+ * @param remote
+ * location of the remote repository.
+ * @return true if the protocol is supported.
+ */
+ public static boolean canHandleProtocol(final URIish remote) {
+ if (TransportGitSsh.canHandle(remote))
+ return true;
+
+ else if (TransportHttp.canHandle(remote))
+ return true;
+
+ else if (TransportSftp.canHandle(remote))
+ return true;
+
+ else if (TransportGitAnon.canHandle(remote))
+ return true;
+
+ else if (TransportAmazonS3.canHandle(remote))
+ return true;
+
+ else if (TransportBundleFile.canHandle(remote))
+ return true;
+
+ else if (TransportLocal.canHandle(remote))
+ return true;
+
+ return false;
+ }
+
+ /**
* Open a new transport instance to connect two repositories.
*
* @param local