|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objecthudson.plugins.jobConfigHistory.JobConfigHistoryBaseAction
public abstract class JobConfigHistoryBaseAction
Implements some basic methods needed by the
JobConfigHistoryRootAction and JobConfigHistoryProjectAction.
| 入れ子のクラスの概要 | |
|---|---|
static class |
JobConfigHistoryBaseAction.SideBySideView
|
| コンストラクタの概要 | |
|---|---|
JobConfigHistoryBaseAction()
Set the Hudson instance. |
|
| メソッドの概要 | |
|---|---|
protected abstract void |
checkConfigurePermission()
See whether the current user may read configurations in the object returned by getAccessControlledObject(). |
void |
doDiffFiles(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Parses the incoming POST request and redirects as
GET showDiffFiles. |
protected abstract hudson.security.AccessControlled |
getAccessControlledObject()
Returns the object for which we want to provide access control. |
protected hudson.XmlFile |
getConfigXml(String diffDir)
Returns the configuration file (default is config.xml) located in
diffDir. |
protected String |
getDiff(File file1,
File file2,
String[] file1Lines,
String[] file2Lines)
Returns a unified diff between two string arrays. |
String |
getDiffFile()
Returns a textual diff between two config.xml files located in
histDir1 and histDir2 directories given as parameters of
Stapler.getCurrentRequest(). |
List<JobConfigHistoryBaseAction.SideBySideView.Line> |
getDiffLines()
Returns side-by-side (i.e. human-readable) diff view lines. |
String |
getDisplayName()
Make method final, as we always want the same display name. |
String |
getFile()
Returns getConfigXml(String) as
String. |
protected hudson.model.Hudson |
getHudson()
Returns the hudson instance. |
String |
getIconFileName()
Make method final, as we always want the same icon file. |
protected JobConfigHistory |
getPlugin()
Returns the JobConfigHistory plugin instance. |
protected String |
getRequestParameter(String parameterName)
Returns the parameter named parameterName from current request. |
String |
getUrlName()
Do not make this method final as JobConfigHistoryRootAction
overrides this method. |
protected abstract boolean |
hasConfigurePermission()
Returns whether the current user may read configurations in the object returned by getAccessControlledObject(). |
boolean |
wantRawOutput()
Do we want 'raw' output? |
boolean |
wantXmlOutput()
Do we want 'xml' output? |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
|---|
public JobConfigHistoryBaseAction()
Hudson instance.
| メソッドの詳細 |
|---|
public final String getDisplayName()
hudson.model.Action 内の getDisplayNamehudson.model.ModelObject 内の getDisplayNamepublic final String getIconFileName()
null to hide the icon if the user is not allowed to configure
jobs.
hudson.model.Action 内の getIconFileNamepublic String getUrlName()
JobConfigHistoryRootAction
overrides this method.
hudson.model.Action 内の getUrlNamepublic final boolean wantRawOutput()
public final boolean wantXmlOutput()
public final String getFile()
throws IOException
getConfigXml(String) as
String.
config.xml found in directory given by the
request parameter file.
IOException - if the config file could not be read or converted to an xml
string.protected hudson.XmlFile getConfigXml(String diffDir)
config.xml) located in
diffDir. diffDir must either start with
HUDSON_HOME and contain config-history or be located
under the configured historyRootDir. It also must not contain a
'..' pattern. Otherwise an IllegalArgumentException will be
thrown.
This is to ensure that this plugin will not be abused to get arbitrary xml configuration files located anywhere on the system.
diffDir - timestamped history directory.
protected String getRequestParameter(String parameterName)
parameterName from current request.
parameterName - name of the parameter.
protected abstract void checkConfigurePermission()
getAccessControlledObject().
protected abstract boolean hasConfigurePermission()
getAccessControlledObject().
protected final hudson.model.Hudson getHudson()
protected final JobConfigHistory getPlugin()
protected abstract hudson.security.AccessControlled getAccessControlledObject()
public final void doDiffFiles(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws javax.servlet.ServletException,
IOException
POST request and redirects as
GET showDiffFiles.
req - incoming requestrsp - outgoing response
javax.servlet.ServletException - when parsing the request as MultipartFormDataParser
does not succeed.
IOException - when the redirection does not succeed.
public final String getDiffFile()
throws IOException
config.xml files located in
histDir1 and histDir2 directories given as parameters of
Stapler.getCurrentRequest().
IOException - if reading one of the config files does not succeed.
public final List<JobConfigHistoryBaseAction.SideBySideView.Line> getDiffLines()
throws IOException
IOException - if reading one of the config files does not succeed.
protected final String getDiff(File file1,
File file2,
String[] file1Lines,
String[] file2Lines)
file1 - first config file.file2 - second config file.file1Lines - the lines of the first file.file2Lines - the lines of the second file.
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||