Autopsy  4.14.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
RuntimeProperties.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2013-2017 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.core;
20 
25 public class RuntimeProperties {
26 
27  private static boolean runningWithGUI = true;
28  private static boolean runningWithGUIFlagHasBeenSet = false;
29  private static boolean runningInTarget = false;
30  private static boolean runningInTargetFlagHasBeenSet = false;
31 
41  public synchronized static void setRunningWithGUI(boolean runningWithGUI) throws RuntimePropertiesException {
42  if (!runningWithGUIFlagHasBeenSet) {
44  runningWithGUIFlagHasBeenSet = true;
45  } else {
46  throw new RuntimePropertiesException("The runningWithGUI flag has already been set and cannot be changed");
47  }
48  }
49 
59  public synchronized static void setRunningInTarget(boolean runningInTarget) throws RuntimePropertiesException{
60  if(!runningInTargetFlagHasBeenSet){
62  runningInTargetFlagHasBeenSet = true;
63  } else {
64  throw new RuntimePropertiesException("The runningLive Flag has already been set and cannot be changed");
65  }
66  }
67 
73  public synchronized static boolean isRunningInTarget() {
74  return runningInTarget;
75  }
76 
83  public synchronized static boolean runningWithGUI() {
84  return runningWithGUI;
85  }
86 
90  private RuntimeProperties() {
91  }
92 
96  public final static class RuntimePropertiesException extends Exception {
97 
98  private static final long serialVersionUID = 1L;
99 
106  public RuntimePropertiesException(String message) {
107  super(message);
108  }
109 
117  public RuntimePropertiesException(String message, Throwable cause) {
118  super(message, cause);
119  }
120  }
121 
122 }
static synchronized void setRunningInTarget(boolean runningInTarget)
static synchronized void setRunningWithGUI(boolean runningWithGUI)
static synchronized boolean runningWithGUI()
static synchronized boolean isRunningInTarget()

Copyright © 2012-2020 Basis Technology. Generated on: Wed Apr 8 2020
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.