Skip to content
Permalink
Browse files
Fix JENKINS-28202
Fixed check for file extension
  • Loading branch information
slide committed May 4, 2015
1 parent 66a6c62 commit d5af533cb9ccb1d91be01d76738263fd6b4f24df
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/main/java/hudson/plugins/emailext/plugins/content/AbstractEvalContent.java
@@ -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;
@@ -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);

0 comments on commit d5af533

Please sign in to comment.