All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.afrozaar.wordpress.wpapi.v2.util.MavenProperties Maven / Gradle / Ivy

There is a newer version: 4.8.3
Show newest version
package com.afrozaar.wordpress.wpapi.v2.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class MavenProperties {

    private static final Logger LOG = LoggerFactory.getLogger(MavenProperties.class);

    public static Properties getProperties() {

        try (InputStream is = MavenProperties.class.getClassLoader().getResourceAsStream("META-INF/maven/com.afrozaar.wordpress/wp-api-v2-client-java/pom.properties")) {
            Properties properties = new Properties();
            try {
                properties.load(is);
            } catch (IOException | NullPointerException e) {
                LOG.error("Error loading properties ", e);
            }
            return properties;
        } catch (IOException ioe) {
            throw new RuntimeException(ioe);
        }
    }

    public static void main(String[] args) {
        getProperties().list(System.out);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy