isSshUrl function

bool isSshUrl(
  1. String url
)

Implementation

bool isSshUrl(String url) {
  var pIndicatorIndex = url.indexOf('://');
  if (pIndicatorIndex != -1) {
    var protocols = url.substring(0, pIndicatorIndex).split('+');
    return protocols.contains('ssh') || protocols.contains('rsync');
  }

  // FIXME: Is there a better way?
  return url.indexOf('@') < url.indexOf(':');
}