本文整理匯總了Java中org.eclipse.jgit.transport.TransportProtocol類的典型用法代碼示例。如果您正苦於以下問題:Java TransportProtocol類的具體用法?Java TransportProtocol怎麽用?Java TransportProtocol使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TransportProtocol類屬於org.eclipse.jgit.transport包,在下文中一共展示了TransportProtocol類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: openTransport
import org.eclipse.jgit.transport.TransportProtocol; //導入依賴的package包/類
protected Transport openTransport (boolean openPush) throws URISyntaxException, NotSupportedException, TransportException {
URIish uri = getUriWithUsername(openPush);
// WA for #200693, jgit fails to initialize ftp protocol
for (TransportProtocol proto : Transport.getTransportProtocols()) {
if (proto.getSchemes().contains("ftp")) { //NOI18N
Transport.unregister(proto);
}
}
try {
Transport transport = Transport.open(getRepository(), uri);
RemoteConfig config = getRemoteConfig();
if (config != null) {
transport.applyConfig(config);
}
if (transport.getTimeout() <= 0) {
transport.setTimeout(45);
}
transport.setCredentialsProvider(getCredentialsProvider());
return transport;
} catch (IllegalArgumentException ex) {
throw new TransportException(ex.getLocalizedMessage(), ex);
}
}
示例2: protocolFor
import org.eclipse.jgit.transport.TransportProtocol; //導入依賴的package包/類
public static TransportProtocol protocolFor(URIish uri) {
for (TransportProtocol p : getTransportProtocols()) {
if (p.canHandle(uri))
return p;
}
return null;
}
示例3: niceProtocolNameFor
import org.eclipse.jgit.transport.TransportProtocol; //導入依賴的package包/類
public static String niceProtocolNameFor(URIish uri) {
TransportProtocol p = protocolFor(uri);
if (p == null) {
return null;
}
if (p.getSchemes().contains("file")) {
return null;
}
String jGitProtocolName = p.getName();
if (jGitProtocolName.equals(JGitText.get().transportProtoGitAnon)) {
return "Git";
}
return jGitProtocolName;
}