package org.helioviewer.jhv.plugins.swek.sources.hek;

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

import org.helioviewer.jhv.plugins.swek.SWEKPlugin;

/**
 * Gives access to the HEK source properties
 * 
 * @author Bram Bourgoignie (Bram.Bourgoignie@oma.be)
 * 
 */
public class HEKSourceProperties {
    private static HEKSourceProperties singletonInstance;

    /** The HEK source properties */
    private final Properties hekSourceProperties;

    /**
     * Private default constructor.
     */
    private HEKSourceProperties() {
        this.hekSourceProperties = new Properties();
        loadProperties();
    }

    /**
     * Gets the singleton instance of the HEK source properties
     * 
     * @return the HEK source properties
     */
    public static HEKSourceProperties getSingletonInstance() {
        if (singletonInstance == null) {
            singletonInstance = new HEKSourceProperties();
        }
        return singletonInstance;
    }

    /**
     * Gets the HEK source properties.
     * 
     * @return the hek source properties
     */
    public Properties getHEKSourceProperties() {
        return this.hekSourceProperties;
    }

    /**
     * Loads the overall hek source settings.
     */
    private void loadProperties() {
        InputStream defaultPropStream = SWEKPlugin.class.getResourceAsStream("/heksource.properties");
        try {
            this.hekSourceProperties.load(defaultPropStream);
        } catch (IOException ex) {
            System.out.println("Could not load the hek settings." + ex);
        }
    }

}

package org.helioviewer.jhv.plugins.swek.sources.hek;

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

/**
 * Gives access to the HEK source properties
 * 
 * @author Bram Bourgoignie (Bram.Bourgoignie@oma.be)
 * 
 */
public class HEKSourceProperties {
    private static HEKSourceProperties singletonInstance;

    /** The HEK source properties */
    private final Properties hekSourceProperties;

    /**
     * Private default constructor.
     */
    private HEKSourceProperties() {
        hekSourceProperties = new Properties();
        loadProperties();
    }

    /**
     * Gets the singleton instance of the HEK source properties
     * 
     * @return the HEK source properties
     */
    public static HEKSourceProperties getSingletonInstance() {
        if (singletonInstance == null) {
            singletonInstance = new HEKSourceProperties();
        }
        return singletonInstance;
    }

    /**
     * Gets the HEK source properties.
     * 
     * @return the hek source properties
     */
    public Properties getHEKSourceProperties() {
        return hekSourceProperties;
    }

    /**
     * Loads the overall hek source settings.
     */
    private void loadProperties() {
        InputStream defaultPropStream = HEKSourceProperties.class.getResourceAsStream("/heksource.properties");
        try {
            hekSourceProperties.load(defaultPropStream);
        } catch (IOException ex) {
            System.out.println("Could not load the hek settings." + ex);
        }
    }

}

Load the properties from via the correct Class otherwise it is not in the class loader
Load the properties from via the correct Class otherwise it is not in the class loader

git-svn-id: 4e353c0944fe8da334633afc35765ef362dec675@2010 b4e469a2-07ce-4b26-9273-4d7d95a670c7
