java properties bundle name

@param bundleName
@param locale
@return convented properties ended file path.
176222
protected final String toJavaResourceName(String bundleName, Locale locale) {
    String fullName = bundleName;
    final String localeName = toLocaleStr(locale);
    final String suffix = "properties";
    if (!"".equals(localeName)) fullName = fullName + "_" + localeName;
    StringBuilder sb = new StringBuilder(fullName.length() + 1 + suffix.length());
    sb.append(fullName.replace('.', '/')).append('.').append(suffix);
    return sb.toString();
  }
585581
public ResourceBundle getResourceBundle() {
        if (bundle == null) {
            String lang = "";
            String country = "";
            final String _locale = getPm().getCfg().getProperty("locale", "");
            if (_locale != null && !"".equals(_locale.trim())) {
                final String[] __locale = _locale.split("[_]");
                lang = __locale[0];
                if (__locale.length > 1) {
                    country = __locale[1];
                }
            }
            final Locale locale = new Locale(lang, country);
            bundle = ResourceBundle.getBundle("ApplicationResource", locale);
        }
        return bundle;
    }
138290
String messageFromFile(Locale locale, String filename, String relatedProperty) {
    String result = null;
    String bundleBase = propertyToBundles.get(relatedProperty);
    if (bundleBase == null) {
      // this property has no translation
      return null;
    }

    String filePath = bundleBase.replace('.', '/');
    if (!"en".equals(locale.getLanguage())) {
      filePath += "_" + locale.getLanguage();
    }
    filePath += "/" + filename;
    InputStream input = classloader.getResourceAsStream(filePath);
    if (input != null) {
      result = readInputStream(filePath, input);
    }
    return result;
  }
938162
public boolean getCustomBundleBooleanProperty(String bundleName, String key) {
		return Boolean.parseBoolean(props.getProperty(
				prefix + PropertiesBundleConstant.BUNDLE_FACTORY_CUSTOM_PROPERTY + bundleName + key, "false"));
	}
228850
public static final char getChar(Locale locale, String key)
   {
      ResourceBundle bundle = ResourceBundle.getBundle(LocaleData.class.getName(), locale);
      return (bundle.getString(key).charAt(0));
   }
742521
public String[] getDetails(Locale locale) {
        if (m_details == null || m_details.length == 0) {
            return s_emptyStringArray;
        }
        String[] ret = new String[m_details.length];
        for (int i = 0; i < m_details.length; i++) {
            ret[i] = getLocalizedOrCode(m_bundleName, locale, m_code, null);
        }
        return ret;
    }
399154
public Properties getLables(JKLocale locale) {
		Properties properties = lables.get(locale);
		if (properties == null) {
			properties = new Properties();
			lables.put(locale, properties);
		}
		return properties;
	}
1162212
private String localize(String key, String defaultValue) {
    String result = defaultValue;
    if (bundle != null) {
      try {
        result = bundle.getString(key);
      }
      catch (MissingResourceException mre) {
      }
    }
    return result;
  }
863362
public ResourceBundle getResourceBundle(String baseName) {
//    System.out.println(this + " " + this.locale+" ("+resourceBundles.size()+")");
    ResourceBundle bundle = (ResourceBundle) resourceBundles.get(baseName);
    if(null == bundle) {
      resourceBundles.put(baseName, bundle = findBundle(baseName));
    }
    return bundle;
  }
1025874
private String getAvailableLocalVariant(String path, String baseName) {

        //First look for a bundle with the locale of the folder..
        try {
            CmsProperty propLoc = m_clonedCms.readPropertyObject(path, CmsPropertyDefinition.PROPERTY_LOCALE, true);
            if (!propLoc.isNullProperty()) {
                if (m_clonedCms.existsResource(path + baseName + "_" + propLoc.getValue())) {
                    return baseName + "_" + propLoc.getValue();
                }
            }
        } catch (CmsException e) {
            LOG.error("Can not read locale property", e);
        }

        //If no bundle was found with the locale of the folder, or the property was not set, search for other locales
        A_CmsUI.get();
        List<String> localVariations = CmsLocaleManager.getLocaleVariants(
            baseName,
            UI.getCurrent().getLocale(),
            false,
            true);

        for (String name : localVariations) {
            if (m_clonedCms.existsResource(path + name)) {
                return name;
            }
        }

        return null;
    }
1250784
private JoinableResourceBundle getBundleFromName(String name, List<JoinableResourceBundle> bundles) {

		JoinableResourceBundle bundle = null;
		for (JoinableResourceBundle aBundle : bundles) {
			if (aBundle.getName().equals(name)) {
				bundle = aBundle;
				break;
			}
		}

		return bundle;
	}
400482
public static IPath getBundlePath(Bundle bundle) {
		IPath path = getBinFolderPath(bundle);
		if (path == null) {
			// common jar file case, no bin folder
			try {
				path = new Path(FileLocator.getBundleFile(bundle).getAbsolutePath());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return path;
	}
641328
private void buildupPropertiesBundles(final File file) throws IOException {
		File[] files = file.listFiles();

		for (File f : files) {
			if (f.getName().endsWith("properties")) {
				String bundleName = f.getName().substring(0,
						f.getName().indexOf("properties") - 1);

				LOG.info("Loading: " + bundleName);
				ResourceBundle bundle = new PropertyResourceBundle(
						new FileInputStream(f));
				bundles.put(bundleName, bundle);
			}
		}
	}
800245
@SuppressWarnings("rawtypes") public static final Map getMap(Locale locale, String key)
   {
      ResourceBundle bundle = ResourceBundle.getBundle(LocaleData.class.getName(), locale);
      return ((Map) bundle.getObject(key));
   }
1202157
private static void localize( final Class<?> i18nClass,
                                  final Locale locale ) {
        assert i18nClass != null;
        assert locale != null;
        // Create a class-to-problem map for this locale if one doesn't exist, else get the existing one.
        Map<Class<?>, Set<String>> classToProblemsMap = new ConcurrentHashMap<Class<?>, Set<String>>();
        Map<Class<?>, Set<String>> existingClassToProblemsMap = LOCALE_TO_CLASS_TO_PROBLEMS_MAP.putIfAbsent(locale,
                                                                                                            classToProblemsMap);
        if (existingClassToProblemsMap != null) {
            classToProblemsMap = existingClassToProblemsMap;
        }
        // Check if already localized outside of synchronization block for 99% use-case
        if (classToProblemsMap.get(i18nClass) != null) {
            return;
        }
        synchronized (i18nClass) {
            // Return if the supplied i18n class has already been localized to the supplied locale, despite the check outside of
            // the synchronization block (1% use-case), else create a class-to-problems map for the class.
            Set<String> problems = classToProblemsMap.get(i18nClass);
            if (problems == null) {
                problems = new CopyOnWriteArraySet<String>();
                classToProblemsMap.put(i18nClass, problems);
            } else {
                return;
            }
            // Get the URL to the localization properties file ...
            final String localizationBaseName = i18nClass.getName();
            URL bundleUrl = ClasspathLocalizationRepository.getLocalizationBundle(i18nClass.getClassLoader(), localizationBaseName, locale);
            if (bundleUrl == null && i18nClass == CommonI18n.class) {
                throw new SystemFailureException("CommonI18n.properties file not found in classpath !");
            }
            if (bundleUrl == null) {
                LOGGER.warn(CommonI18n.i18nBundleNotFoundInClasspath,
                            ClasspathLocalizationRepository.getPathsToSearchForBundle(localizationBaseName, locale));
                // Nothing was found, so try the default locale
                Locale defaultLocale = Locale.getDefault();
                if (!defaultLocale.equals(locale)) {
                    bundleUrl = ClasspathLocalizationRepository.getLocalizationBundle(i18nClass.getClassLoader(), localizationBaseName, defaultLocale);
                }
                // Return if no applicable localization file could be found
                if (bundleUrl == null) {
                    LOGGER.error(CommonI18n.i18nBundleNotFoundInClasspath,
                                 ClasspathLocalizationRepository.getPathsToSearchForBundle(localizationBaseName, defaultLocale));
                    LOGGER.error(CommonI18n.i18nLocalizationFileNotFound, localizationBaseName);
                    problems.add(CommonI18n.i18nLocalizationFileNotFound.text(localizationBaseName));
                    return;
                }
            }
            // Initialize i18n map
            Properties props = prepareBundleLoading(i18nClass, locale, bundleUrl, problems);

            try {
                InputStream propStream = bundleUrl.openStream();
                try {
                    props.load(propStream);
                    // Check for uninitialized fields
                    for (Field fld : i18nClass.getDeclaredFields()) {
                        if (fld.getType() == I18n.class) {
                            try {
                                I18n i18n = (I18n)fld.get(null);
                                if (i18n.localeToTextMap.get(locale) == null) {
                                    i18n.localeToProblemMap.put(locale,
                                                                CommonI18n.i18nPropertyMissing.text(fld.getName(), bundleUrl));
                                }
                            } catch (IllegalAccessException notPossible) {
                                // Would have already occurred in initialize method, but allowing for the impossible...
                                problems.add(notPossible.getMessage());
                            }
                        }
                    }
                } finally {
                    propStream.close();
                }
            } catch (IOException err) {
                problems.add(err.getMessage());
            }
        }
    }
521368
public Set<String> getBundleCodes(Locale locale,String...basenames){
		List<String> validBaseNames = getValidBasenames(basenames);
		
		Set<String> codes = new HashSet<>();
		for(String basename: validBaseNames){
			List<Pair<String, Resource>> filenamesAndResources = calculateAllFilenames(basename,locale);
			for (Pair<String, Resource> filenameAndResource : filenamesAndResources) {
				if(filenameAndResource.getbValue() != null) {
					PropertiesHolder propHolder = getProperties(filenameAndResource.getaValue(), filenameAndResource.getbValue());
					codes.addAll(propHolder.getProperties().stringPropertyNames());					
				}
			}
		}
		return codes;
	}
534264
public List<String> getCustomBundlePropertyAsList(String bundleName, String key) {
		List<String> propertiesList = new ArrayList<>();
		StringTokenizer tk = new StringTokenizer(getCustomBundleProperty(bundleName, key, ""), ",");
		while (tk.hasMoreTokens())
			propertiesList.add(tk.nextToken().trim());
		return propertiesList;
	}