Skip to content

Commit

Permalink
Fix JENKINS-28202
Browse files Browse the repository at this point in the history
Fixed check for file extension
  • Loading branch information
slide committed May 4, 2015
1 parent 66a6c62 commit d5af533
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -36,6 +36,7 @@
import java.io.IOException;
import java.io.InputStream;
import jenkins.model.Jenkins;
import org.apache.commons.io.FilenameUtils;
import org.jenkinsci.lib.configprovider.ConfigProvider;
import org.jenkinsci.lib.configprovider.model.Config;
import org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro;
Expand Down Expand Up @@ -92,10 +93,12 @@ protected InputStream getFileInputStream(String fileName, String extension)
return inputStream;
}

String fileExt = FilenameUtils.getExtension(fileName);

// add .jelly if needed
if (!fileName.endsWith(extension)) {
if (fileExt.equals("")) {
fileName += extension;
}
}

inputStream = getClass().getClassLoader().getResourceAsStream(
"hudson/plugins/emailext/templates/" + fileName);
Expand Down

0 comments on commit d5af533

Please sign in to comment.