public static RepositoryId extractRepositoryFromScmUrl ( String url ) { if ( StringUtils . isEmpty ( url ) ) return null ; int ghIndex = url . indexOf ( HOST_DEFAULT ) ; if ( ghIndex == - 1 || ghIndex + 1 >= url . length ( ) ) return null ; if ( ! url . endsWith ( SUFFIX_GIT ) ) return null ; url = url . substring ( ghIndex + HOST_DEFAULT . length ( ) + 1 , url . length ( ) - SUFFIX_GIT . length ( ) ) ; return RepositoryId . createFromId ( url ) ; }
Extra repository id from given SCM URL