public StorageProvider create ( StorageProviderCredentials credentials ) { StorageProviderType storageProviderType = credentials . getProviderType ( ) ; if ( storageProviderType . equals ( StorageProviderType . AMAZON_S3 ) ) { return new S3StorageProvider ( credentials . getAccessKey ( ) , credentials . getSecretKey ( ) , credentials . getOptions ( ) ) ; } else if ( storageProviderType . equals ( StorageProviderType . AMAZON_GLACIER ) ) { return new GlacierStorageProvider ( credentials . getAccessKey ( ) , credentials . getSecretKey ( ) , credentials . getOptions ( ) ) ; } else if ( storageProviderType . equals ( StorageProviderType . CHRONOPOLIS ) ) { return new ChronopolisStorageProvider ( credentials . getAccessKey ( ) , credentials . getSecretKey ( ) ) ; } throw new RuntimeException ( storageProviderType + " is not a supported storage provider type" ) ; }
Creates a StorageProvider