19 package org.sleuthkit.autopsy.texttranslation.translators;
21 import org.apache.commons.lang3.StringUtils;
50 String getAuthenticationKey() {
60 void setAuthenticationKey(String authKey) {
61 authenticationKey = authKey;
68 if (!ModuleSettings.configExists(BING_TRANSLATE_NAME)) {
69 ModuleSettings.makeConfigFile(BING_TRANSLATE_NAME);
71 if (ModuleSettings.settingExists(BING_TRANSLATE_NAME, AUTHENTICATION_KEY)) {
72 authenticationKey = ModuleSettings.getConfigSetting(BING_TRANSLATE_NAME, AUTHENTICATION_KEY);
74 if (authenticationKey == null || StringUtils.isBlank(authenticationKey)) {
77 if (ModuleSettings.settingExists(BING_TRANSLATE_NAME, TARGET_LANGUAGE_CODE_KEY)) {
78 targetLanguageCode = ModuleSettings.getConfigSetting(BING_TRANSLATE_NAME, TARGET_LANGUAGE_CODE_KEY);
80 if (targetLanguageCode == null || StringUtils.isBlank(targetLanguageCode)) {
90 String getTargetLanguageCode() {
100 void setTargetLanguageCode(String code) {
101 if (StringUtils.isBlank(code)) {
104 targetLanguageCode = code;
111 void saveSettings() {
112 ModuleSettings.setConfigSetting(BING_TRANSLATE_NAME, AUTHENTICATION_KEY, authenticationKey);
113 ModuleSettings.setConfigSetting(BING_TRANSLATE_NAME, TARGET_LANGUAGE_CODE_KEY, targetLanguageCode);
static final String DEFAULT_AUTHENTICATION
static final String AUTHENTICATION_KEY
static final String DEFAULT_TARGET_LANGUAGE
static final String BING_TRANSLATE_NAME
static final String TARGET_LANGUAGE_CODE_KEY
String targetLanguageCode