Autopsy  4.12.0
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  private static String getVersionProperty(String property) {
57  if (versionProperties == null) {
58  return "";
59  } else {
60  return versionProperties.getProperty(property);
61  }
62  }
63 
69  public static String getVersion() {
70  return getVersionProperty("app.version");
71  }
72 
78  public static String getName() {
79  return getVersionProperty("app.name");
80  }
81 
87  public static Version.Type getBuildType() {
88  String valueProp = getVersionProperty("build.type");
89  return Type.valueOf(valueProp);
90  }
91 
92  public static String getJavaRuntimeVersion() {
93  return System.getProperty("java.runtime.version");
94  }
95 
96  public static String getNetbeansBuild() {
97  return System.getProperty("netbeans.buildnumber");
98  }
99 
100  public static String getNetbeansProductVersion() {
101  return System.getProperty("netbeans.productversion");
102  }
103 }
static Version.Type getBuildType()
Definition: Version.java:87
static String getVersionProperty(String property)
Definition: Version.java:55

Copyright © 2012-2018 Basis Technology. Generated on: Wed Sep 18 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.