Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
RESTful Web Service Discoverability with Spring MVC 3.1, part 4 - the HTTP Header utils
public static List< String > parseLinkHeader( String linkHeader ){
Preconditions.checkNotNull( linkHeader );
List< String > linkHeaders = Lists.newArrayList();
String[] links = linkHeader.split( ", " );
for( final String link : links ){
int positionOfSeparator = link.indexOf( ';' );
linkHeaders.add( link.substring( 1, positionOfSeparator - 1 ) );
}
return linkHeaders;
}
public static String parseSingleLinkHeader( String linkHeader ){
Preconditions.checkNotNull( linkHeader );
int positionOfSeparator = linkHeader.indexOf( ';' );
return linkHeader.substring( 1, positionOfSeparator - 1 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.