Skip to content
Permalink
Browse files
Fixed JENKINS-18157
Check if file already ends with .jelly and don't add if it does.
  • Loading branch information
slide committed May 31, 2013
1 parent a8254d5 commit 16a8d52dc4d65b586dc5310a07152d68a0cd78c0
Showing 1 changed file with 6 additions and 2 deletions.
@@ -88,12 +88,16 @@ private String generateMissingTemplate(String template) {
*/
private InputStream getTemplateInputStream(String templateName)
throws FileNotFoundException {
// add .jelly if needed
if(!templateName.endsWith(".jelly")) {
templateName += ".jelly";
}
InputStream inputStream = getClass().getClassLoader().getResourceAsStream(
"hudson/plugins/emailext/templates/" + templateName + ".jelly");
"hudson/plugins/emailext/templates/" + templateName);

if (inputStream == null) {
final File templatesFolder = new File(Hudson.getInstance().getRootDir(), EMAIL_TEMPLATES_DIRECTORY);
final File templateFile = new File(templatesFolder, templateName + ".jelly");
final File templateFile = new File(templatesFolder, templateName);
inputStream = new FileInputStream(templateFile);
}

0 comments on commit 16a8d52

Please sign in to comment.