Autopsy  4.20.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
CentralRepoSettings.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2022 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.centralrepository;
20 
21 import java.io.File;
22 import java.nio.file.Paths;
24 
28 public class CentralRepoSettings {
29 
30  private static final CentralRepoSettings instance = new CentralRepoSettings();
31 
35  public static CentralRepoSettings getInstance() {
36  return instance;
37  }
38 
39  private static final String CENTRAL_REPOSITORY_FOLDER = "CentralRepository";
40  private static final String CENTRAL_REPOSITORY_SETTINGS_NAME = "CentralRepository";
41  private static final String CENTRAL_REPO_BASE_PATH = Paths.get(
43  CENTRAL_REPOSITORY_FOLDER).toString();
44 
45  private static final String DEFAULT_DB_PARENT_PATH = Paths.get(CENTRAL_REPO_BASE_PATH, "LocalDatabase").toString();
46  private static final String DEFAULT_DB_NAME = "central_repository.db";
47 
48  // NOTE: if this changes, an equivalent fix will be needed in CentralRepoDatamodelTest for the String PROPERTIES_FILE
49  private static final String MODULE_SETTINGS_KEY = Paths.get(
50  Paths.get(PlatformUtil.getUserConfigDirectory()).relativize(Paths.get(PlatformUtil.getModuleConfigDirectory())).toString(),
53 
54  private static final String MODULE_SETTINGS_PROPERTIES = Paths.get(
55  CENTRAL_REPO_BASE_PATH,
56  CENTRAL_REPOSITORY_SETTINGS_NAME + ".properties").toString();
57 
58  private static final String DATABASE_NAME_KEY = "db.sqlite.dbName"; //NON-NLS
59  private static final String DATABASE_PATH_KEY = "db.sqlite.dbDirectory"; //NON-NLS
60 
64  public String getSettingsBaseFolder() {
66  }
67 
72  public String getModuleSettingsKey() {
73  return MODULE_SETTINGS_KEY;
74  }
75 
79  public String getModuleSettingsFile() {
81  }
82 
86  public String getDefaultDbPath() {
88  }
89 
93  public String getDefaultDbName() {
94  return DEFAULT_DB_NAME;
95  }
96 
100  public String getDatabaseNameKey() {
101  return DATABASE_NAME_KEY;
102  }
103 
107  public String getDatabasePathKey() {
108  return DATABASE_PATH_KEY;
109  }
110 
111 
112 }

Copyright © 2012-2022 Basis Technology. Generated on: Tue Aug 1 2023
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.