001/*
002 * Copyright (c) 2012-2018 Institut National des Sciences Appliquées de Lyon (INSA Lyon) and others
003 *
004 * This program and the accompanying materials are made available under the
005 * terms of the Eclipse Public License 2.0 which is available at
006 * http://www.eclipse.org/legal/epl-2.0.
007 *
008 * SPDX-License-Identifier: EPL-2.0
009 */
010
011package org.eclipse.golo.cli.command;
012
013import java.io.IOException;
014import java.io.InputStream;
015import java.util.Properties;
016
017public final class Metadata {
018
019  private Metadata() {
020    // purely static class
021  }
022
023  public static final String VERSION;
024  public static final String TIMESTAMP;
025  public static final String GUIDE_BASE;
026
027  static {
028    Properties props = new Properties();
029    try (InputStream inputStream = Metadata.class.getResourceAsStream("/metadata.properties")) {
030      props.load(inputStream);
031      VERSION = props.getProperty("version");
032      TIMESTAMP = props.getProperty("timestamp");
033      GUIDE_BASE = props.getProperty("guide-url");
034    } catch (IOException e) {
035      throw new AssertionError("Could not load metadata.properties from the current classpath.");
036    }
037  }
038}