Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
CheckOutScmResult |
|
| 1.1666666666666667;1,167 |
1 | package org.apache.maven.scm.command.checkout; | |
2 | ||
3 | /* | |
4 | * Licensed to the Apache Software Foundation (ASF) under one | |
5 | * or more contributor license agreements. See the NOTICE file | |
6 | * distributed with this work for additional information | |
7 | * regarding copyright ownership. The ASF licenses this file | |
8 | * to you under the Apache License, Version 2.0 (the | |
9 | * "License"); you may not use this file except in compliance | |
10 | * with the License. You may obtain a copy of the License at | |
11 | * | |
12 | * http://www.apache.org/licenses/LICENSE-2.0 | |
13 | * | |
14 | * Unless required by applicable law or agreed to in writing, | |
15 | * software distributed under the License is distributed on an | |
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
17 | * KIND, either express or implied. See the License for the | |
18 | * specific language governing permissions and limitations | |
19 | * under the License. | |
20 | */ | |
21 | ||
22 | import java.util.List; | |
23 | ||
24 | import org.apache.maven.scm.ScmFile; | |
25 | import org.apache.maven.scm.ScmResult; | |
26 | ||
27 | /** | |
28 | * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a> | |
29 | * @author Olivier Lamy | |
30 | * @version $Id: CheckOutScmResult.java 1294391 2012-02-27 23:16:22Z hboutemy $ | |
31 | */ | |
32 | public class CheckOutScmResult | |
33 | extends ScmResult | |
34 | { | |
35 | ||
36 | private static final long serialVersionUID = 3345964619749320210L; | |
37 | ||
38 | private List<ScmFile> checkedOutFiles; | |
39 | ||
40 | /** | |
41 | * The relative path of the directory of the checked out project in comparison to the checkout directory, or | |
42 | * an empty String in case the checkout directory equals the project directory. | |
43 | * <p/> | |
44 | * With most SCMs, this is just an empty String, meaning that the checkout directory equals the project directory. | |
45 | * But there are cases (e.g. ClearCase) where within the checkout directory, the directory structure of the | |
46 | * SCM system is repeated. E.g. if you check out the project "my/project" to "/some/dir", the project sources | |
47 | * are actually checked out to "my/project/some/dir". In this example, relativePathProjectDirectory would | |
48 | * contain "my/project". | |
49 | */ | |
50 | 0 | protected String relativePathProjectDirectory = ""; |
51 | ||
52 | public CheckOutScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) | |
53 | { | |
54 | 0 | super( commandLine, providerMessage, commandOutput, success ); |
55 | 0 | } |
56 | ||
57 | public CheckOutScmResult( String commandLine, List<ScmFile> checkedOutFiles ) | |
58 | { | |
59 | 0 | super( commandLine, null, null, true ); |
60 | ||
61 | 0 | this.checkedOutFiles = checkedOutFiles; |
62 | 0 | } |
63 | ||
64 | public CheckOutScmResult( String commandLine, List<ScmFile> checkedOutFiles, String relativePathProjectDirectory ) | |
65 | { | |
66 | 0 | this( commandLine, checkedOutFiles ); |
67 | ||
68 | 0 | if ( relativePathProjectDirectory != null ) |
69 | { | |
70 | 0 | this.relativePathProjectDirectory = relativePathProjectDirectory; |
71 | } | |
72 | 0 | } |
73 | ||
74 | public CheckOutScmResult( List<ScmFile> checkedOutFiles, ScmResult result ) | |
75 | { | |
76 | 0 | super( result ); |
77 | ||
78 | 0 | this.checkedOutFiles = checkedOutFiles; |
79 | 0 | } |
80 | ||
81 | public List<ScmFile> getCheckedOutFiles() | |
82 | { | |
83 | 0 | return checkedOutFiles; |
84 | } | |
85 | ||
86 | /** | |
87 | * @return the contents of {@link #relativePathProjectDirectory} | |
88 | * @see #relativePathProjectDirectory | |
89 | */ | |
90 | public String getRelativePathProjectDirectory() | |
91 | { | |
92 | 0 | return relativePathProjectDirectory; |
93 | } | |
94 | } |