Skip to content
Permalink
Browse files
[JENKINS-37350] Don't use random for File name in Save to Workspace o…
…ption (#138)
  • Loading branch information
cjuroz authored and davidvanlaatum committed Aug 13, 2016
1 parent a9b5b51 commit 186435cd8139eb99656b76f60b63dd698cfa27b9
Showing with 1 addition and 3 deletions.
  1. +1 −3 src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java
@@ -43,7 +43,6 @@
import java.util.Date;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -747,14 +746,13 @@ private Multipart addContent(ExtendedEmailPublisherContext context, String chars

try {
if (saveOutput) {
Random random = new Random();
String extension = ".html";
if (messageContentType.startsWith("text/plain")) {
extension = ".txt";
}

FilePath savedOutput = new FilePath(context.getWorkspace(),
String.format("%s-%s%d%s", context.getTrigger().getDescriptor().getDisplayName(), context.getRun().getId(), random.nextInt(), extension));
String.format("%s-%s%s", context.getTrigger().getDescriptor().getDisplayName(), context.getRun().getId(), extension));
savedOutput.write(text, charset);
}
} catch (IOException | InterruptedException e) {

0 comments on commit 186435c

Please sign in to comment.