// Path: src/main/java/org/fuin/utils4j/Utils4J.java
// public static void checkNotNull(final String name, final Object value) {
//     if (value == null) {
//         throw new IllegalNullArgumentException(name);
//     }
// }
// 
// Path: src/main/java/org/fuin/utils4j/Utils4J.java
// public static void checkValidFile(final File file) {
//     checkNotNull("file", file);
//     if (!file.exists()) {
//         throw new IllegalArgumentException("The file '" + file + "' does not exist!");
//     }
//     if (!file.isFile()) {
//         throw new IllegalArgumentException("The name '" + file + "' is not a file!");
//     }
// }
// 
// Path: src/main/java/org/fuin/utils4j/Utils4J.java
// public static URL createUrl(final URL baseUrl, final String path, final String filename) {
//     checkNotNull("baseUrl", baseUrl);
//     checkNotNull("filename", filename);
//     try {
//         String baseUrlStr = baseUrl.toString();
//         if (!baseUrlStr.endsWith(SLASH)) {
//             baseUrlStr = baseUrlStr + SLASH;
//         }
//         final String pathStr;
//         if ((path == null) || (path.length() == 0)) {
//             pathStr = "";
//         } else {
//             if (path.endsWith(SLASH)) {
//                 pathStr = path;
//             } else {
//                 pathStr = path + SLASH;
//             }
//         }
//         return new URL(baseUrlStr + pathStr + filename);
//     } catch (final IOException ex) {
//         throw new RuntimeException(ex);
//     }
// }
// 
// Path: src/main/java/org/fuin/utils4j/Utils4J.java
// public static String getPackagePath(final Class<?> clasz) {
//     checkNotNull("clasz", clasz);
//     return clasz.getPackage().getName().replace('.', '/');
// }


import java.util.Properties;
import static org.fuin.utils4j.Utils4J.checkNotNull;
import static org.fuin.utils4j.Utils4J.checkValidFile;
import static org.fuin.utils4j.Utils4J.createUrl;
import static org.fuin.utils4j.Utils4J.getPackagePath;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;

        final Properties props = new Properties();
        try (final InputStream inStream = loader.getResourceAsStream(resource)) {
            if (inStream == null) {
                throw new IllegalArgumentException("Resource '" + resource + "' not found!");
            }
            props.load(inStream);
        } catch (final IOException ex) {
            throw new RuntimeException(ex);
        }
        return props;
    }

    /**
     * Load properties from a file.
     * 
     * @param file
     *            Properties file - Cannot be <code>null</code> and must be a valid file.
     * 
     * @return Properties.
     */
    public static Properties loadProperties(final File file) {
        checkNotNull("file", file);
        checkValidFile(file);
        final Properties props = new Properties();
        try (final InputStream inStream = new FileInputStream(file)) {
            props.load(inStream);
        } catch (final IOException ex) {
            throw new RuntimeException(ex);
        }
// Path: src/main/java/org/fuin/utils4j/Utils4J.java
// public static void checkNotNull(final String name, final Object value) {
//     if (value == null) {
//         throw new IllegalNullArgumentException(name);
//     }
// }
// 
// Path: src/main/java/org/fuin/utils4j/Utils4J.java
// public static void checkValidFile(final File file) {
//     checkNotNull("file", file);
//     if (!file.exists()) {
//         throw new IllegalArgumentException("The file '" + file + "' does not exist!");
//     }
//     if (!file.isFile()) {
//         throw new IllegalArgumentException("The name '" + file + "' is not a file!");
//     }
// }
// 
// Path: src/main/java/org/fuin/utils4j/Utils4J.java
// public static URL createUrl(final URL baseUrl, final String path, final String filename) {
//     checkNotNull("baseUrl", baseUrl);
//     checkNotNull("filename", filename);
//     try {
//         String baseUrlStr = baseUrl.toString();
//         if (!baseUrlStr.endsWith(SLASH)) {
//             baseUrlStr = baseUrlStr + SLASH;
//         }
//         final String pathStr;
//         if ((path == null) || (path.length() == 0)) {
//             pathStr = "";
//         } else {
//             if (path.endsWith(SLASH)) {
//                 pathStr = path;
//             } else {
//                 pathStr = path + SLASH;
//             }
//         }
//         return new URL(baseUrlStr + pathStr + filename);
//     } catch (final IOException ex) {
//         throw new RuntimeException(ex);
//     }
// }
// 
// Path: src/main/java/org/fuin/utils4j/Utils4J.java
// public static String getPackagePath(final Class<?> clasz) {
//     checkNotNull("clasz", clasz);
//     return clasz.getPackage().getName().replace('.', '/');
// }


// Path: src/main/java/org/fuin/utils4j/PropertiesUtils.java
import java.util.Properties;
import static org.fuin.utils4j.Utils4J.checkNotNull;
import static org.fuin.utils4j.Utils4J.checkValidFile;
import static org.fuin.utils4j.Utils4J.createUrl;
import static org.fuin.utils4j.Utils4J.getPackagePath;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;


        final Properties props = new Properties();
        try (final InputStream inStream = loader.getResourceAsStream(resource)) {
            if (inStream == null) {
                throw new IllegalArgumentException("Resource '" + resource + "' not found!");
            }
            props.load(inStream);
        } catch (final IOException ex) {
            throw new RuntimeException(ex);
        }
        return props;
    }

    /**
     * Load properties from a file.
     * 
     * @param file
     *            Properties file - Cannot be <code>null</code> and must be a valid file.
     * 
     * @return Properties.
     */
    public static Properties loadProperties(final File file) {
        checkNotNull("file", file);
        checkValidFile(file);
        final Properties props = new Properties();
        try (final InputStream inStream = new FileInputStream(file)) {
            props.load(inStream);
        } catch (final IOException ex) {
            throw new RuntimeException(ex);
        }
        return props;