Skip to content

Commit

Permalink
[JENKINS-37350] Don't use random for File name in Save to Workspace o…
Browse files Browse the repository at this point in the history
…ption (#138)
  • Loading branch information
cjuroz authored and davidvanlaatum committed Aug 13, 2016
1 parent a9b5b51 commit 186435c
Showing 1 changed file with 1 addition and 3 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 186435c

Please sign in to comment.