// 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);
// }


import com.tngtech.propertyloader.impl.interfaces.PropertyLoaderOpener;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
package com.tngtech.propertyloader.impl.openers;



/**
 * Searches for properties files at a file system path.
 * The search path can be provided as a String or an URL.
 * Use the empty constructor to search the current directory.
 */
public class URLFileOpener implements PropertyLoaderOpener {

    private URL url;

    public URLFileOpener() {
        try {
            this.url = new File("").toURI().toURL();
        } catch (MalformedURLException e) {
// 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/openers/URLFileOpener.java
import com.tngtech.propertyloader.impl.interfaces.PropertyLoaderOpener;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;

package com.tngtech.propertyloader.impl.openers;



/**
 * Searches for properties files at a file system path.
 * The search path can be provided as a String or an URL.
 * Use the empty constructor to search the current directory.
 */
public class URLFileOpener implements PropertyLoaderOpener {

    private URL url;

    public URLFileOpener() {
        try {
            this.url = new File("").toURI().toURL();
        } catch (MalformedURLException e) {
            throw new RuntimeException(String.format("THIS CAN NOT HAPPEN: error while forming URL from path '%s'", ""), e);