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

io.confound.demo.app.ConfoundAppDemo Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
/*
 * Copyright © 2018 GlobalMentor, Inc. 
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.confound.demo.app;

import static io.confound.Confound.*;

import javax.annotation.*;

/**
 * Demonstration of using Confound in an application.
 * 

* This application demonstrates using a single confound-app-provider dependency to automatically discover an application data directory in * app.data.dir, indicated as a system property or as an environment variable. The directory can be absolute or relative to the user home * directory. The configuration file will be discovered in that directory with the base filename config and an extension based upon the file format * providers installed. *

*

* By default properties files and XML properties files are supported. *

* @author Garret Wilson */ public class ConfoundAppDemo { /** * Main application entry point. * @param args Command-line arguments. */ public static void main(@Nonnull final String[] args) { System.out.println(String.format("Foo is %s.", getConfiguration().getOptionalString("foo").orElse("[missing]"))); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy