diff --git a/implementation/src/main/java/io/smallrye/config/PropertiesConfigSourceProvider.java b/implementation/src/main/java/io/smallrye/config/PropertiesConfigSourceProvider.java deleted file mode 100644 index 875d7459a..000000000 --- a/implementation/src/main/java/io/smallrye/config/PropertiesConfigSourceProvider.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.smallrye.config; - -import java.io.IOException; -import java.net.URI; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.microprofile.config.spi.ConfigSource; -import org.eclipse.microprofile.config.spi.ConfigSourceProvider; - -/** - * @author Jeff Mesnil (c) 2017 Red Hat inc. - */ -@Deprecated(forRemoval = true) -public class PropertiesConfigSourceProvider extends AbstractLocationConfigSourceLoader implements ConfigSourceProvider { - private final List configSources = new ArrayList<>(); - private final boolean includeFileSystem; - - public PropertiesConfigSourceProvider(final String location, final ClassLoader classLoader, - final boolean includeFileSystem) { - this.includeFileSystem = includeFileSystem; - this.configSources.addAll(loadConfigSources(location, ConfigSource.DEFAULT_ORDINAL, classLoader)); - } - - @Override - public List getConfigSources(ClassLoader forClassLoader) { - return configSources; - } - - @Override - protected String[] getFileExtensions() { - return new String[] { "properties" }; - } - - @Override - protected ConfigSource loadConfigSource(final URL url, final int ordinal) throws IOException { - return new PropertiesConfigSource(url, ordinal); - } - - @Override - protected List tryFileSystem(final URI uri, final int ordinal) { - if (includeFileSystem) { - return super.tryFileSystem(uri, ordinal); - } else { - return new ArrayList<>(); - } - } - - public static PropertiesConfigSourceProvider resource(final String location, final ClassLoader classLoader) { - return new PropertiesConfigSourceProvider(location, classLoader, true); - } - - public static PropertiesConfigSourceProvider classPathResource(final String location, final ClassLoader classLoader) { - return new PropertiesConfigSourceProvider(location, classLoader, false); - } - - public static List propertiesSources(final String location, final ClassLoader classLoader) { - return resource(location, classLoader).getConfigSources(classLoader); - } - - public static List classPathSources(final String location, final ClassLoader classLoader) { - return classPathResource(location, classLoader).getConfigSources(classLoader); - } -} diff --git a/sources/yaml/src/main/java/io/smallrye/config/source/yaml/YamlConfigSourceProvider.java b/sources/yaml/src/main/java/io/smallrye/config/source/yaml/YamlConfigSourceProvider.java deleted file mode 100644 index 3b8e8ebfb..000000000 --- a/sources/yaml/src/main/java/io/smallrye/config/source/yaml/YamlConfigSourceProvider.java +++ /dev/null @@ -1,35 +0,0 @@ -package io.smallrye.config.source.yaml; - -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.microprofile.config.spi.ConfigSource; -import org.eclipse.microprofile.config.spi.ConfigSourceProvider; - -import io.smallrye.config.AbstractLocationConfigSourceLoader; - -@Deprecated(forRemoval = true) -public class YamlConfigSourceProvider extends AbstractLocationConfigSourceLoader implements ConfigSourceProvider { - @Override - public String[] getFileExtensions() { - return new String[] { - "yaml", - "yml" - }; - } - - @Override - protected ConfigSource loadConfigSource(final URL url, final int ordinal) throws IOException { - return new YamlConfigSource(url, ordinal); - } - - @Override - public Iterable getConfigSources(ClassLoader classLoader) { - final List sources = new ArrayList<>(); - sources.addAll(loadConfigSources("META-INF/microprofile-config.yaml", 110, classLoader)); - sources.addAll(loadConfigSources("META-INF/microprofile-config.yml", 110, classLoader)); - return sources; - } -}