1 package org.apache.maven.scm.command.checkout;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.scm.CommandParameter;
23 import org.apache.maven.scm.CommandParameters;
24 import org.apache.maven.scm.ScmException;
25 import org.apache.maven.scm.ScmFileSet;
26 import org.apache.maven.scm.ScmResult;
27 import org.apache.maven.scm.ScmVersion;
28 import org.apache.maven.scm.command.AbstractCommand;
29 import org.apache.maven.scm.provider.ScmProviderRepository;
30
31
32
33
34
35
36
37 public abstract class AbstractCheckOutCommand
38 extends AbstractCommand
39 {
40
41
42
43
44
45
46
47
48
49
50 protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet,
51 ScmVersion scmVersion )
52 throws ScmException
53 {
54 return executeCheckOutCommand( repository, fileSet, scmVersion, true );
55 }
56
57
58
59
60
61
62
63
64
65
66
67
68 protected abstract CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet,
69 ScmVersion scmVersion, boolean recursive )
70 throws ScmException;
71
72
73 public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
74 CommandParameters parameters )
75 throws ScmException
76 {
77 ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null );
78 String recursiveParam = parameters.getString( CommandParameter.RECURSIVE, null );
79 if ( recursiveParam != null )
80 {
81 boolean recursive = parameters.getBoolean( CommandParameter.RECURSIVE );
82 return executeCheckOutCommand( repository, fileSet, scmVersion, recursive );
83 }
84
85 return executeCheckOutCommand( repository, fileSet, scmVersion );
86 }
87 }