public static List<String> getSplat(List<String> request, List<String> matched) {
        int nbrOfRequestParts = request.size();
        int nbrOfMatchedParts = matched.size();

        boolean sameLength = (nbrOfRequestParts == nbrOfMatchedParts);

        List<String> splat = new ArrayList<>();

        for (int i = 0; (i < nbrOfRequestParts) && (i < nbrOfMatchedParts); i++) {
            String matchedPart = matched.get(i);

            if (SparkUtils.isSplat(matchedPart)) {

                StringBuilder splatParam = new StringBuilder(request.get(i));
                if (!sameLength && (i == (nbrOfMatchedParts - 1))) {
                    for (int j = i + 1; j < nbrOfRequestParts; j++) {
                        splatParam.append("/");
                        splatParam.append(request.get(j));
                    }
                }
                splat.add(splatParam.toString());
            }
        }
        return Collections.unmodifiableList(splat);
    }
public static List<String> getSplat(List<String> request, List<String> matched) {
        int nbrOfRequestParts = request.size();
        int nbrOfMatchedParts = matched.size();

        boolean sameLength = (nbrOfRequestParts == nbrOfMatchedParts);

        List<String> splat = new ArrayList<>();

        for (int i = 0; (i < nbrOfRequestParts) && (i < nbrOfMatchedParts); i++) {
            String matchedPart = matched.get(i);

            if (SparkUtils.isSplat(matchedPart)) {

                StringBuilder splatParam = new StringBuilder(request.get(i));
                if (!sameLength && (i == (nbrOfMatchedParts - 1))) {
                    for (int j = i + 1; j < nbrOfRequestParts; j++) {
                        splatParam.append("/");
                        splatParam.append(request.get(j));
                    }
                }
                splat.add(splatParam.toString());
            }
        }
        return Collections.unmodifiableList(splat);
    }
public static List < String > getSplat ( List < String > request , List < String > matched ) { int nbrOfRequestParts = request . size ( ) ; int nbrOfMatchedParts = matched . size ( ) ; boolean sameLength = ( nbrOfRequestParts == nbrOfMatchedParts ) ; List < String > splat = new ArrayList <> ( ) ; for ( int i = 0 ; ( i < nbrOfRequestParts ) && ( i < nbrOfMatchedParts ) ; i ++ ) { String matchedPart = matched . get ( i ) ; if ( SparkUtils . isSplat ( matchedPart ) ) { StringBuilder splatParam = new StringBuilder ( request . get ( i ) ) ; if ( ! sameLength && ( i == ( nbrOfMatchedParts - 1 ) ) ) { for ( int j = i + 1 ; j < nbrOfRequestParts ; j ++ ) { splatParam . append ( "/" ) ; splatParam . append ( request . get ( j ) ) ; } } splat . add ( splatParam . toString ( ) ) ; } } return Collections . unmodifiableList ( splat ) ; }
taken from spark (https://github.com/perwendel/spark)
taken from spark ( https : // github . com / perwendel / spark )