@SuppressWarnings("unchecked")
static public Index getInstance( final CharSequence basename, final boolean randomAccess, final boolean documentSizes, final EnumMap<UriKeys,String> queryProperties ) throws ConfigurationException, IOException, ClassNotFoundException, SecurityException, URISyntaxException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
final Properties properties = new Properties( basename + DiskBasedIndex.PROPERTIES_EXTENSION );
ClusteringStrategy strategy = null;
Class<? extends ClusteringStrategy> strategyClass = null;
if ( properties.containsKey( PropertyKeys.STRATEGY ) ) strategy = (ClusteringStrategy)BinIO.loadObject( properties.getString( PropertyKeys.STRATEGY ) );
else if ( properties.containsKey( PropertyKeys.STRATEGYCLASS ) ) try {
strategyClass = (Class<? extends ClusteringStrategy>)MG4JClassParser.getParser().parse( properties.getString( PropertyKeys.STRATEGYCLASS ) );
}
catch ( ParseException e ) {
throw new RuntimeException( e );