class JavaPropertyScanner extends AbstractPropertyScanner implements PropertyScanner {

    @Override
    public File findTemplate(File propertyFile, ScanConfiguration config) {
        Matcher matcher = LOCALE_PATTERN.matcher(propertyFile.getName());
        if(!matcher.matches())
            return null;
        String prefix = matcher.group(1);
        String suffix = matcher.group(3);
        StringBuilder filename = new StringBuilder(prefix);
        if(config.getMasterLocale()!=null)
        {
            filename.append("_");
            filename.append(config.getMasterLocale());
        }
        filename.append(suffix);
        return new File(propertyFile.getParentFile(),filename.toString());
    }

}