
hudson.plugins.scm_sync_configuration.ScmSyncConfigurationDataProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scm-sync-configuration Show documentation
Show all versions of scm-sync-configuration Show documentation
SCM Sync Configuration Hudson plugin is aimed at 2 main features : First, keep sync'ed your config.xml (and other ressources) hudson files with a SCM repository (backup), Secondly, track changes (and author) made on every file with commit messages.
The newest version!
package hudson.plugins.scm_sync_configuration;
import org.kohsuke.stapler.StaplerRequest;
public class ScmSyncConfigurationDataProvider {
private static final String COMMENT_SESSION_KEY = "commitMessage";
public static void provideComment(StaplerRequest request, String comment){
request.getSession().setAttribute(COMMENT_SESSION_KEY, comment);
}
public static String retrieveComment(StaplerRequest request, boolean cleanComment){
return (String)retrieveObject(request, COMMENT_SESSION_KEY, cleanComment);
}
private static Object retrieveObject(StaplerRequest request, String key, boolean cleanObject){
Object obj = request.getSession().getAttribute(key);
if(cleanObject){
request.getSession().removeAttribute(key);
}
return obj;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy