public static IStoreClient getStoreClient ( URI fsuri , Configuration conf ) throws IOException { final String fsSchema = fsuri . toString ( ) . substring ( 0 , fsuri . toString ( ) . indexOf ( "://" ) ) ; final ClassLoader classLoader = ObjectStoreVisitor . class . getClassLoader ( ) ; String [ ] supportedSchemas = conf . get ( "fs.stocator.scheme.list" , Constants . SWIFT ) . split ( "," ) ; for ( String scheme : supportedSchemas ) { final String supportedScheme = conf . get ( "fs.stocator." + scheme . trim ( ) + ".scheme" , Constants . SWIFT2D ) ; final String implementation = conf . get ( "fs.stocator." + scheme . trim ( ) + ".impl" , "com.ibm.stocator.fs.swift.SwiftAPIClient" ) ; LOG . debug ( "Stocator schema space : {}, provided {}. Implementation {}" , fsSchema , supportedScheme , implementation ) ; if ( fsSchema . equals ( supportedScheme ) ) { LOG . info ( "Stocator registered as {} for {}" , fsSchema , fsuri . toString ( ) ) ; IStoreClient storeClient ; try { LOG . debug ( "Load implementation class {}" , implementation ) ; if ( fsSchema . equals ( "cos" ) || fsSchema . equals ( "s3d" ) ) { LOG . debug ( "Load direct init for COSAPIClient. Overwrite {}" , implementation ) ; storeClient = new COSAPIClient ( fsuri , conf ) ; } else { final Class < ? > aClass = classLoader . loadClass ( implementation ) ; storeClient = ( IStoreClient ) aClass . getConstructor ( URI . class , Configuration . class ) . newInstance ( fsuri , conf ) ; } } catch ( InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException | SecurityException | ClassNotFoundException e ) { LOG . error ( "Exception in load implementation class {}: {}" , implementation , e . getMessage ( ) ) ; throw new IOException ( "No object store for: " + fsSchema , e ) ; } try { storeClient . initiate ( supportedScheme ) ; return storeClient ; } catch ( IOException e ) { LOG . error ( e . getMessage ( ) ) ; throw e ; } } } throw new IOException ( "No object store for: " + fsSchema ) ; }
fs . stocator . scheme . list contains comma separated list of the provided back - end storage drivers . If none provided or key is not present then swift is the default value .