// Path: src/main/java/com/tngtech/propertyloader/impl/interfaces/PropertyLoaderOpener.java
// public interface PropertyLoaderOpener {
// 
//     /**
//      * Attempt to find and open some property file.
//      *
//      * @param fileName A relative filename (using '/' as directory separator on all platforms)
//      * @return An input stream reading from that file, or null if the file could not be found
//      */
//     InputStream open(String fileName);
// }
// 
// Path: src/main/java/com/tngtech/propertyloader/impl/interfaces/PropertyLocationsContainer.java
// public interface PropertyLocationsContainer<T> {
// 
//     T atDefaultLocations();
// 
//     T atCurrentDirectory();
// 
//     T atHomeDirectory();
// 
//     T atDirectory(String directory);
// 
//     T atContextClassPath();
// 
//     T atRelativeToClass(Class<?> reference);
// 
//     T atClassLoader(ClassLoader classLoader);
// 
//     T atBaseURL(URL url);
// }


import com.tngtech.propertyloader.impl.interfaces.PropertyLoaderOpener;
import com.tngtech.propertyloader.impl.interfaces.PropertyLocationsContainer;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
package com.tngtech.propertyloader.impl;



public class DefaultPropertyLocationContainer implements PropertyLocationsContainer<DefaultPropertyLocationContainer> {

    private final PropertyLoaderFactory propertyLoaderFactory;

    private final List<PropertyLoaderOpener> openers = new ArrayList<>();

    public DefaultPropertyLocationContainer(PropertyLoaderFactory propertyLoaderFactory) {
        this.propertyLoaderFactory = propertyLoaderFactory;
    }

    public List<PropertyLoaderOpener> getOpeners() {
        return openers;
    }

    public DefaultPropertyLocationContainer atDefaultLocations() {
        atCurrentDirectory();
        atContextClassPath();
        atHomeDirectory();
        return this;
    }

    public DefaultPropertyLocationContainer atCurrentDirectory() {
        openers.add(propertyLoaderFactory.getURLFileOpener());
        return this;
    }

    public DefaultPropertyLocationContainer atHomeDirectory() {
        openers.add(propertyLoaderFactory.getURLFileOpener(System.getProperty("user.home")));
// Path: src/main/java/com/tngtech/propertyloader/impl/interfaces/PropertyLoaderOpener.java
// public interface PropertyLoaderOpener {
// 
//     /**
//      * Attempt to find and open some property file.
//      *
//      * @param fileName A relative filename (using '/' as directory separator on all platforms)
//      * @return An input stream reading from that file, or null if the file could not be found
//      */
//     InputStream open(String fileName);
// }
// 
// Path: src/main/java/com/tngtech/propertyloader/impl/interfaces/PropertyLocationsContainer.java
// public interface PropertyLocationsContainer<T> {
// 
//     T atDefaultLocations();
// 
//     T atCurrentDirectory();
// 
//     T atHomeDirectory();
// 
//     T atDirectory(String directory);
// 
//     T atContextClassPath();
// 
//     T atRelativeToClass(Class<?> reference);
// 
//     T atClassLoader(ClassLoader classLoader);
// 
//     T atBaseURL(URL url);
// }


// Path: src/main/java/com/tngtech/propertyloader/impl/DefaultPropertyLocationContainer.java
import com.tngtech.propertyloader.impl.interfaces.PropertyLoaderOpener;
import com.tngtech.propertyloader.impl.interfaces.PropertyLocationsContainer;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

package com.tngtech.propertyloader.impl;



public class DefaultPropertyLocationContainer implements PropertyLocationsContainer<DefaultPropertyLocationContainer> {

    private final PropertyLoaderFactory propertyLoaderFactory;

    private final List<PropertyLoaderOpener> openers = new ArrayList<>();

    public DefaultPropertyLocationContainer(PropertyLoaderFactory propertyLoaderFactory) {
        this.propertyLoaderFactory = propertyLoaderFactory;
    }

    public List<PropertyLoaderOpener> getOpeners() {
        return openers;
    }

    public DefaultPropertyLocationContainer atDefaultLocations() {
        atCurrentDirectory();
        atContextClassPath();
        atHomeDirectory();
        return this;
    }

    public DefaultPropertyLocationContainer atCurrentDirectory() {
        openers.add(propertyLoaderFactory.getURLFileOpener());
        return this;
    }

    public DefaultPropertyLocationContainer atHomeDirectory() {
        openers.add(propertyLoaderFactory.getURLFileOpener(System.getProperty("user.home")));
        return this;