KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hudson > scm > NullSCM


1 package hudson.scm;
2
3 import hudson.FilePath;
4 import hudson.Launcher;
5 import hudson.model.AbstractBuild;
6 import hudson.model.AbstractProject;
7 import hudson.model.BuildListener;
8 import hudson.model.Descriptor;
9 import hudson.model.TaskListener;
10 import org.kohsuke.stapler.StaplerRequest;
11
12 import java.io.File JavaDoc;
13 import java.io.IOException JavaDoc;
14 import java.util.Map JavaDoc;
15
16 /**
17  * No {@link SCM}.
18  *
19  * @author Kohsuke Kawaguchi
20  */

21 public class NullSCM extends SCM {
22     public boolean pollChanges(AbstractProject project, Launcher launcher, FilePath dir, TaskListener listener) throws IOException JavaDoc {
23         // no change
24
return false;
25     }
26
27     public boolean checkout(AbstractBuild build, Launcher launcher, FilePath remoteDir, BuildListener listener, File JavaDoc changeLogFile) throws IOException JavaDoc {
28         return createEmptyChangeLog(changeLogFile, listener, "log");
29     }
30
31     public boolean checkout(Launcher launcher, FilePath workspace, TaskListener listener) throws IOException JavaDoc, InterruptedException JavaDoc {
32         return true;
33     }
34
35     public Descriptor<SCM> getDescriptor() {
36         return DESCRIPTOR;
37     }
38
39     public void buildEnvVars(Map JavaDoc<String JavaDoc,String JavaDoc> env) {
40         // noop
41
}
42
43     public FilePath getModuleRoot(FilePath workspace) {
44         return workspace;
45     }
46
47     public ChangeLogParser createChangeLogParser() {
48         return new NullChangeLogParser();
49     }
50
51     static final Descriptor<SCM> DESCRIPTOR = new Descriptor<SCM>(NullSCM.class) {
52         public String JavaDoc getDisplayName() {
53             return "None";
54         }
55
56         public SCM newInstance(StaplerRequest req) {
57             return new NullSCM();
58         }
59     };
60 }
61
Popular Tags