Autopsy  4.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
FactoryClassNameNormalizer.java
Go to the documentation of this file.
1 /*
2  * To change this license header, choose License Headers in Project Properties.
3  * To change this template file, choose Tools | Templates
4  * and open the template in the editor.
5  */
6 package org.sleuthkit.autopsy.ingest;
7 
9 
13 class FactoryClassNameNormalizer {
14 
15  private static final CharSequence pythonModuleSettingsPrefixCS = "org.python.proxies.".subSequence(0, "org.python.proxies.".length() - 1); //NON-NLS
16  private static final Logger logger = Logger.getLogger(FactoryClassNameNormalizer.class.getName());
17 
18  static String normalize(String canonicalClassName) {
19  if (isPythonModuleSettingsFile(canonicalClassName)) {
20  // compiled python modules have variable instance number as a part of their file name.
21  // This block of code gets rid of that variable instance number and helps maitains constant module name over multiple runs.
22  String moduleClassName = canonicalClassName.replaceAll("[$][\\d]", ""); //NON-NLS NON-NLS
23  return moduleClassName;
24  }
25  return canonicalClassName;
26  }
27 
38  private static boolean isPythonModuleSettingsFile(String moduleSettingsFilePath) {
39  return moduleSettingsFilePath.contains(pythonModuleSettingsPrefixCS);
40  }
41 
42 }
synchronized static Logger getLogger(String name)
Definition: Logger.java:161

Copyright © 2012-2016 Basis Technology. Generated on: Mon Apr 24 2017
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.