Autopsy  3.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
Version.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.coreutils;
20 
21 import java.io.IOException;
22 import java.io.InputStream;
23 import java.util.Properties;
24 
28 public class Version {
29 
30  private static Properties versionProperties;
31 
32  private Version() {
33  }
34 
35  public enum Type {
36 
37  RELEASE, DEVELOPMENT;
38  }
39 
40  private static void loadVersionProperty() {
41  if (versionProperties != null) {
42  return;
43  }
44 
45  versionProperties = new Properties();
46  try {
47  InputStream inputStream = Version.class.getResourceAsStream("Version.properties"); //NON-NLS
48  versionProperties.load(inputStream);
49  } catch (IOException e) {
50  versionProperties = null;
51  }
52 
53 
54  }
55 
56  private static String getVersionProperty(String property) {
58  if (versionProperties == null) {
59  return "";
60  } else {
61  return versionProperties.getProperty(property);
62  }
63  }
64 
70  public static String getVersion() {
71  return getVersionProperty("app.version");
72  }
73 
79  public static String getName() {
80  return getVersionProperty("app.name");
81  }
82 
88  public static Version.Type getBuildType() {
89  String valueProp = getVersionProperty("build.type");
90  return Type.valueOf(valueProp);
91  }
92 
93  public static String getJavaRuntimeVersion() {
94  return System.getProperty("java.runtime.version");
95  }
96 
97  public static String getNetbeansBuild() {
98  return System.getProperty("netbeans.buildnumber");
99  }
100 
101  public static String getNetbeansProductVersion() {
102  return System.getProperty("netbeans.productversion");
103  }
104 }
static Version.Type getBuildType()
Definition: Version.java:88
static String getVersionProperty(String property)
Definition: Version.java:56

Copyright © 2012-2015 Basis Technology. Generated on: Mon Oct 19 2015
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.