Autopsy  4.21.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Installer.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2023 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 com.basistech.df.cybertriage.autopsy.ctoptions.ctcloud;
20 
25 import java.util.Optional;
26 import java.util.logging.Level;
27 import org.openide.modules.ModuleInstall;
28 import org.openide.util.NbBundle.Messages;
31 
35 public class Installer extends ModuleInstall {
36  private final static Logger LOGGER = Logger.getLogger(Installer.class.getName());
37 
38  private final static Installer INSTANCE = new Installer();
39 
40  public static Installer getDefault() {
41  return INSTANCE;
42  }
43 
44  private Installer() {}
45 
46  @Override
47  public void restored() {
48  new Thread(new LicenseCheck()).start();
49  }
50 
51  @Messages({
52  "Installer_LicenseCheck_cloudExceptionTitle=Cyber Triage Error"
53  })
54  private static class LicenseCheck implements Runnable {
55 
56  @Override
57  public void run() {
58  try {
59  Optional<LicenseInfo> licenseInfoOpt = CTLicensePersistence.getInstance().loadLicenseInfo();
60  if (licenseInfoOpt.isEmpty()) {
61  return;
62  }
63 
64  LicenseInfo licenseInfo = licenseInfoOpt.get();
66  // if we got this far, then it was a successful request
67  } catch (CTCloudException cloudEx) {
68  LOGGER.log(Level.WARNING, "A cloud exception occurred while fetching an auth token", cloudEx);
69  MessageNotifyUtil.Notify.warn(Bundle.Installer_LicenseCheck_cloudExceptionTitle(), cloudEx.getErrorDetails());
70  } catch (Throwable t) {
71  LOGGER.log(Level.WARNING, "An error occurred while fetching license info", t);
72  }
73  }
74  }
75 }
AuthTokenResponse getAuthToken(DecryptedLicenseResponse decrypted)
Definition: CTApiDAO.java:81
synchronized static Logger getLogger(String name)
Definition: Logger.java:124

Copyright © 2012-2024 Sleuth Kit Labs. Generated on: Mon Mar 17 2025
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.