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

org.duracloud.common.util.SystemPropertiesVerifier Maven / Gradle / Ivy

There is a newer version: 8.0.0
Show newest version
/*
 * The contents of this file are subject to the license and copyright
 * detailed in the LICENSE and NOTICE files at the root of the source
 * tree and available online at
 *
 *     http://duracloud.org/license/
 */
package org.duracloud.common.util;

/**
 * @author Daniel Bernstein
 *         Date: Sep 12, 2014
 */
public  class SystemPropertiesVerifier {

    private String[] props;
    public SystemPropertiesVerifier(String[] props){
        this.props = props;
    }
    
    public void verify(){
        for(String prop : props){
            verifySystemProp(prop);
        }
    }

    /**
     * @param key
     */
    protected  void verifySystemProp(String key) {
        if (System.getProperty(key) == null){
            throw new RuntimeException("required system property " + key
                    + " has not been set.");
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy