Support files with no extension in config mappings

This commit is contained in:
Igor Motov 2012-07-24 13:07:30 -04:00 committed by Shay Banon
parent a63aa6cc18
commit 0a5a068269
1 changed files with 2 additions and 1 deletions

View File

@ -415,7 +415,8 @@ public class MetaDataCreateIndexService extends AbstractComponent {
if (mappingFile.isHidden()) {
continue;
}
String mappingType = mappingFile.getName().substring(0, mappingFile.getName().lastIndexOf('.'));
int lastDotIndex = mappingFile.getName().lastIndexOf('.');
String mappingType = lastDotIndex != -1 ? mappingFile.getName().substring(0, lastDotIndex) : mappingFile.getName();
try {
String mappingSource = Streams.copyToString(new FileReader(mappingFile));
if (mappings.containsKey(mappingType)) {