@Nullable public static Pair<String,String> splitJarUrl(@NotNull String url){
  int pivot=url.indexOf(JAR_SEPARATOR);
  if (pivot < 0)   return null;
  String resourcePath=url.substring(pivot + 2);
  String jarPath=url.substring(0,pivot);
  if (StringUtil.startsWithConcatenation(jarPath,JAR_PROTOCOL,":")) {
    jarPath=jarPath.substring(JAR_PROTOCOL.length() + 1);
  }
  if (jarPath.startsWith(FILE_PROTOCOL)) {
    jarPath=jarPath.substring(FILE_PROTOCOL.length());
    if (jarPath.startsWith(SCHEME_SEPARATOR)) {
      jarPath=jarPath.substring(SCHEME_SEPARATOR.length());
    }
 else     if (StringUtil.startsWithChar(jarPath,':')) {
      jarPath=jarPath.substring(1);
    }
  }
  return Pair.create(jarPath,resourcePath);
}

@ Nullable public static Pair < String , String > splitJarUrl ( @ NotNull String url ) { int pivot = url . indexOf ( JAR_SEPARATOR ) ; if ( pivot < 0 ) return null ; String resourcePath = url . substring ( pivot + 2 ) ; String jarPath = url . substring ( 0 , pivot ) ; if ( StringUtil . startsWithConcatenation ( jarPath , JAR_PROTOCOL , ":" ) ) { jarPath = jarPath . substring ( JAR_PROTOCOL . length ( ) + 1 ) ; } if ( jarPath . startsWith ( FILE_PROTOCOL ) ) { jarPath = jarPath . substring ( FILE_PROTOCOL . length ( ) ) ; if ( jarPath . startsWith ( SCHEME_SEPARATOR ) ) { jarPath = jarPath . substring ( SCHEME_SEPARATOR . length ( ) ) ; } else if ( StringUtil . startsWithChar ( jarPath , ':' ) ) { jarPath = jarPath . substring ( 1 ) ; } } return Pair . create ( jarPath , resourcePath ) ; }
splits . jar url along a separator and strips " jar " and " file " prefixes if any . returns a pair of path to a . jar file and entry name inside a . jar , or null if the url does not contain a separator . < p / > e . g . " jar : file : / / / path / to / jar . jar ! / resource . xml " is converted into [ " / path / to / jar . jar " , " resource . xml " ] .
