View Javadoc

1   package org.apache.maven.index;
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.ArrayList;
23  import java.util.List;
24  
25  /**
26   * A scanning result holds result of repository scan
27   * 
28   * @author Jason van Zyl
29   */
30  public class ScanningResult
31  {
32      private int totalFiles = 0;
33  
34      private int deletedFiles = 0;
35  
36      private List<Exception> exceptions = new ArrayList<Exception>();
37  
38      private final ScanningRequest request;
39  
40      public ScanningResult( ScanningRequest request )
41      {
42          this.request = request;
43      }
44  
45      public void setTotalFiles( int totalFiles )
46      {
47          this.totalFiles = totalFiles;
48      }
49  
50      public void setDeletedFiles( int deletedFiles )
51      {
52          this.deletedFiles = deletedFiles;
53      }
54  
55      public int getTotalFiles()
56      {
57          return totalFiles;
58      }
59  
60      public int getDeletedFiles()
61      {
62          return deletedFiles;
63      }
64  
65      public void addException( Exception e )
66      {
67          exceptions.add( e );
68      }
69  
70      public boolean hasExceptions()
71      {
72          return exceptions.size() != 0;
73      }
74  
75      public List<Exception> getExceptions()
76      {
77          return exceptions;
78      }
79  
80      public ScanningRequest getRequest()
81      {
82          return request;
83      }
84  
85  }