package io.dropwizard.configuration;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

An implementation of ConfigurationSourceProvider that reads the configuration from the local file system.
/** * An implementation of {@link ConfigurationSourceProvider} that reads the configuration from the * local file system. */
public class FileConfigurationSourceProvider implements ConfigurationSourceProvider { @Override public InputStream open(String path) throws IOException { final File file = new File(path); if (!file.exists()) { throw new FileNotFoundException("File " + file + " not found"); } return new FileInputStream(file); } }