* index. If it is null, we assume it is a property file and load it. Otherwise, we
* assume it is a valid property file URI and try to download it. */
final String uriString = uri.toString();
if ( uriString.startsWith( "mg4j:" ) ) {
final URI u = new URI( uriString );
return IndexServer.getIndex( u.getHost(), u.getPort(), randomAccess, documentSizes );
}
final String basename, query;
if ( uriString.startsWith( "file:" ) ) {
final URI u = new URI( uriString );
basename = u.getPath();
query = u.getQuery();
}
else {
final int questionMarkPos = uriString.indexOf( '?' );
basename = questionMarkPos == -1 ? uriString : uriString.substring( 0, questionMarkPos );
query = questionMarkPos == -1 ? null : uriString.substring( questionMarkPos + 1 );