MATSIM
ReleaseInfo.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * ReleaseInfo.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2008 by the members listed in the COPYING, *
8  * LICENSE and WARRANTY file. *
9  * email : info at matsim dot org *
10  * *
11  * *********************************************************************** *
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * See also COPYING, LICENSE and WARRANTY file *
18  * *
19  * *********************************************************************** */
20 
21 package org.matsim.run;
22 
23 import java.io.BufferedReader;
24 import java.io.IOException;
25 import java.io.InputStreamReader;
26 import java.net.URL;
27 import java.nio.charset.StandardCharsets;
28 
34 public class ReleaseInfo {
35 
36  public static void main(final String[] args) {
37 
38  // try to load the svn-revision used to build and the build-date from the information in the jar-file
39  String revision = null;
40  String date = null;
41  URL url = ReleaseInfo.class.getResource("/revision.txt");
42  if (url != null) {
43  try (BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream(), StandardCharsets.UTF_8))) {
44  revision = reader.readLine();
45  date = reader.readLine();
46  } catch (IOException e) {
47  e.printStackTrace();
48  }
49  }
50 
51  // output copyright-message
52  System.out.println();
53  System.out.println("MATSim");
54  System.out.println(" Multi-Agent Transport Simulation Toolkit");
55  if (revision == null) {
56  System.out.println(" Build: unknown");
57  } else {
58  System.out.println(" Build: " + revision + " (" + date + ")");
59  }
60 
61  System.out.println();
62  System.out.println("Copyright (C) 2012 by");
63  System.out.println(" Kay W. Axhausen, Michael Balmer, Christoph Dobler, Thibaut Dubernet,");
64  System.out.println(" Dominik Grether, Andreas Horni, Gregor Laemmel, Nicolas Lefebvre,");
65  System.out.println(" Fabrice Marchal, Konrad Meister, Kai Nagel, Andreas Neumann,");
66  System.out.println(" Marcel Rieser, David Strippgen, Rashid Waraich, Michael Zilske,");
67  System.out.println(" Technische Universitaet Berlin (TU-Berlin) and");
68  System.out.println(" Swiss Federal Institute of Technology Zurich (ETHZ)");
69  System.out.println();
70  System.out.println("This program is distributed under the Gnu Public License (GPL) 2 and");
71  System.out.println("comes WITHOUT ANY WARRANTY.");
72  System.out.println("Please see the files WARRANTY, LICENSE and COPYING in the distribution.");
73  System.out.println();
74  }
75 
76 }
static void main(final String[] args)