Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49fb679
commit 9baf7b5
Showing
2 changed files
with
55 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 1 addition & 57 deletions
58
src/main/java/org/jenkinsci/plugins/buildresulttrigger/BuildResultTriggerAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,10 @@ | ||
package org.jenkinsci.plugins.buildresulttrigger; | ||
|
||
import hudson.Util; | ||
import hudson.console.AnnotatedLargeText; | ||
import hudson.model.AbstractProject; | ||
import hudson.model.Action; | ||
import org.apache.commons.jelly.XMLOutput; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.charset.Charset; | ||
|
||
/** | ||
* @author Gregory Boissinot | ||
*/ | ||
public class BuildResultTriggerAction implements Action { | ||
|
||
private transient AbstractProject<?, ?> job; | ||
private transient File logFile; | ||
private transient String label; | ||
|
||
public BuildResultTriggerAction(AbstractProject<?, ?> job, File logFile, String label) { | ||
this.job = job; | ||
this.logFile = logFile; | ||
this.label = label; | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
public AbstractProject<?, ?> getOwner() { | ||
return job; | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
public String getLabel() { | ||
return label; | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
public String getLog() throws IOException { | ||
return Util.loadFile(getLogFile()); | ||
} | ||
|
||
public File getLogFile() { | ||
return logFile; | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
public void writeLogTo(XMLOutput out) throws IOException { | ||
new AnnotatedLargeText<BuildResultTriggerAction>(getLogFile(), Charset.defaultCharset(), true, this).writeHtmlTo(0, out.asWriter()); | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
public String getIconFileName() { | ||
return "clipboard.gif"; | ||
} | ||
|
||
public String getDisplayName() { | ||
return "BuildResultTrigger Log"; | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
public String getUrlName() { | ||
return "buildResultTriggerPollLog"; | ||
} | ||
public abstract class BuildResultTriggerAction implements Action { | ||
|
||
} |