Example usage for org.apache.commons.configuration ConfigurationException ConfigurationException

List of usage examples for org.apache.commons.configuration ConfigurationException ConfigurationException

Introduction

In this page you can find the example usage for org.apache.commons.configuration ConfigurationException ConfigurationException.

Prototype

public ConfigurationException(Throwable cause) 

Source Link

Document

Constructs a new ConfigurationException with specified nested Throwable.

Usage

From source file:ubic.gemma.loader.expression.arrayExpress.SDRFFetcher.java

@Override
protected void initConfig() {
    localBasePath = ConfigUtils.getString("arrayExpress.local.datafile.basepath");
    remoteBaseDir = ConfigUtils.getString("arrayExpress.experiments.baseDir");

    if (localBasePath == null || localBasePath.length() == 0)
        throw new RuntimeException(new ConfigurationException("localBasePath was null or empty"));
    if (remoteBaseDir == null || remoteBaseDir.length() == 0)
        throw new RuntimeException(new ConfigurationException("baseDir was null or empty"));

}

From source file:ubic.gemma.loader.expression.geo.fetcher.PlatformFetcher.java

@Override
protected void initConfig() {
    this.localBasePath = ConfigUtils.getString("geo.local.datafile.basepath");
    this.remoteBaseDir = ConfigUtils.getString("geo.remote.platformDir");
    if (remoteBaseDir == null) {
        throw new RuntimeException(
                new ConfigurationException("geo.remote.platformDir was not defined in resource bundle"));
    }//from w  ww.  j a v  a 2  s  .c om

}

From source file:ubic.gemma.loader.expression.geo.fetcher.RawDataFetcher.java

/**
 * @throws ConfigurationException//from  w w w . j  a v a 2s  .com
 */
@Override
public void initConfig() {
    localBasePath = ConfigUtils.getString("geo.local.datafile.basepath");
    remoteBaseDir = ConfigUtils.getString("geo.remote.rawDataDir");

    if (localBasePath == null || localBasePath.length() == 0)
        throw new RuntimeException(new ConfigurationException("localBasePath was null or empty"));
    if (remoteBaseDir == null || remoteBaseDir.length() == 0)
        throw new RuntimeException(new ConfigurationException("baseDir was null or empty"));

}

From source file:ubic.gemma.loader.genome.gene.ncbi.homology.HomologeneFetcher.java

/**
 * @throws ConfigurationException/*from  ww w. j  ava 2  s .  com*/
 */
@Override
protected void initConfig() {

    localBasePath = ConfigUtils.getString("ncbi.local.homologene.basepath");
    remoteBaseDir = ConfigUtils.getString("ncbi.remote.homologene.basedir");

    if (localBasePath == null || localBasePath.length() == 0)
        throw new RuntimeException(new ConfigurationException("localBasePath was null or empty"));
    if (remoteBaseDir == null || remoteBaseDir.length() == 0)
        throw new RuntimeException(new ConfigurationException("baseDir was null or empty"));

}

From source file:ubic.gemma.loader.genome.gene.ncbi.NCBIGeneFileFetcher.java

@Override
public void initConfig() {
    this.localBasePath = ConfigUtils.getString("ncbi.local.datafile.basepath");
    this.remoteBaseDir = ConfigUtils.getString("ncbi.remote.gene.basedir");

    if (remoteBaseDir == null)
        throw new RuntimeException(new ConfigurationException("Failed to get basedir"));
    if (localBasePath == null)
        throw new RuntimeException(new ConfigurationException("Failed to get localBasePath"));

}

From source file:ubic.gemma.loader.genome.taxon.TaxonFetcher.java

@Override
public void initConfig() {
    this.localBasePath = ConfigUtils.getString("ncbi.local.datafile.basepath");
    this.remoteBaseDir = ConfigUtils.getString("ncbi.remote.taxon.basedir");

    if (remoteBaseDir == null)
        throw new RuntimeException(new ConfigurationException("Failed to get basedir"));
    if (localBasePath == null)
        throw new RuntimeException(new ConfigurationException("Failed to get localBasePath"));
}

From source file:ubic.gemma.loader.protein.biomart.BiomartEnsemblNcbiFetcher.java

/**
 * Configure the URL for biomart/*from w ww  . j  a  v a 2s.co  m*/
 * 
 * @throws ConfigurationException one of the file download paths in the properties file was not configured
 *         correctly.
 */
public void initConfig() {

    urlBiomartService = ConfigUtils.getString(BIOMARTPATH);
    if (urlBiomartService == null || urlBiomartService.length() == 0)
        throw new RuntimeException(new ConfigurationException(BIOMARTPATH + " was null or empty"));
}

From source file:ubic.gemma.loader.protein.string.StringProteinFileFetcher.java

/**
 * Sets the paths of the remote files to download as set in the project properties files
 * /*w  ww  .ja  v  a 2  s  . c o m*/
 * @throws ConfigurationException one of the file download paths in the properties file was not configured
 *         correctly.
 */
@Override
public void initConfig() {

    stringProteinFileName = ConfigUtils.getString(INTERACTION);
    if (stringProteinFileName == null || stringProteinFileName.length() == 0)
        throw new RuntimeException(new ConfigurationException(INTERACTION + " was null or empty"));
}

From source file:ubic.gemma.loader.protein.StringProteinProteinInteractionConverter.java

/**
 * @param ensembl2ncbi Map of ensembl peptide ids to entrez/ncbi id genes.
 *//*  w w  w . ja  v a  2 s .com*/
public StringProteinProteinInteractionConverter(Map<String, Ensembl2NcbiValueObject> ensembl2ncbi) {
    this.ensembl2ncbi = ensembl2ncbi;

    stringVersion = ConfigUtils.getString("protein.string.version");
    stringUrl = ConfigUtils.getString("protein.string.linksurl");
    if (stringUrl == null || stringUrl.length() == 0)
        throw new RuntimeException(new ConfigurationException("stringUrl was null or empty"));
    if (stringVersion == null || stringVersion.length() == 0)
        throw new RuntimeException(new ConfigurationException("stringVersion was null or empty"));
}

From source file:uk.q3c.krail.core.config.DefaultApplicationConfigurationService.java

/**
 * The {@link #iniFiles} map is processed in ascending key order. If a file does not exist or fails to load for any
 * reason, and it is not marked as optional in IniFileConfig, a {@link ConfigurationException} is thrown. If,
 * however, the file fails to load, and is optional, no exception is raised.
 *
 * @throws ConfigurationException//from   w  w  w  . j  a  v  a2s .  c o m
 *         if an error occurs while loading a file
 */
@Override
protected void doStart() throws ConfigurationException {
    Set<Integer> keySorter = new TreeSet<>(iniFiles.keySet());
    for (Integer k : keySorter) {
        IniFileConfig iniConfig = iniFiles.get(k);
        File file = new File(ResourceUtils.configurationDirectory(), iniConfig.getFilename());
        try {
            if (!file.exists()) {
                throw new FileNotFoundException(file.getAbsolutePath());
            }
            HierarchicalINIConfiguration config = new HierarchicalINIConfiguration(file);
            configuration.addConfiguration(config);
            log.debug("adding configuration from {} at index {}", file.getAbsolutePath(), k);
        } catch (Exception ce) {
            if (!iniConfig.isOptional()) {
                String msg = ("Configuration Service failed to start, unable to load required configuration file:"
                        + " " + file.getAbsolutePath());
                status = Status.FAILED_TO_START;
                log.error(msg);
                throw new ConfigurationException(ce);
            } else {
                log.info("Optional configuration file not found at {}, but as it is optional, " + ""
                        + "continuing without it", file);

            }
        }
    }

    log.info("Application Configuration Service started");
}