/** * Returns the data store provider, or {@code null} if none. * * @todo on the JDK9 branch, use the {@code ServiceLoader} API that allows us * to filter by class without instantiation. */ final DataStoreProvider provider() throws InvalidOptionException { if (providerClass != null) { for (final DataStoreProvider provider : DataStores.providers()) { if (providerClass.isInstance(provider)) { return provider; } } } return null; } }
/** * Returns a provider having an {@linkplain DataStoreProvider#getOpenParameters() identification} * equals (ignoring case) to the given string. If more than one provider is found, then this * method selects an arbitrary one. If no factory is found, then this method returns * {@code null}. * * @param identifier The identifier of the factory to find. * @return A factory for the given identifier, or {@code null} if none. */ public static synchronized DataStoreProvider getProviderById(final String identifier) { for (final DataStoreProvider factory : org.apache.sis.storage.DataStores.providers()) { for (String name : IdentifiedObjects.getNames(factory.getOpenParameters(),null)) { if (name.equals(identifier)) { return factory; } } } return null; }
final Set<T> results = new HashSet<>(); loop: for (DataStoreProvider p : org.apache.sis.storage.DataStores.providers()) { if (clazz != null && !clazz.isInstance(p)) continue; if (types != null && types.length > 0) {
/** * Returns a provider for the given format name. * * @param format name of the format for which to get a provider. * @return first provider found for the given format name. * @throws UnsupportedStorageException if no provider is found for the specified format. * * @see StoreMetadata#formatName() */ public static DataStoreProvider providerByFormatName(final String format) throws UnsupportedStorageException { for (DataStoreProvider provider : DataStores.providers()) { if (format.equalsIgnoreCase(getFormatName(provider))) { return provider; } } throw new UnsupportedStorageException(Errors.format(Errors.Keys.UnsupportedFormat_1, format)); }
final Collection<DataStoreProvider> providers = DataStores.providers(); final int count = providers.size(); final String[] list = new String[count * 2];
final Collection<DataStoreProvider> providers = DataStores.providers(); final int count = providers.size(); final String[] list = new String[count * 2];