Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 16a8d52
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -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);
}

Expand Down

0 comments on commit 16a8d52

Please sign in to comment.