1 package org.apache.maven.index;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23
24 import org.apache.maven.index.context.IndexingContext;
25 import org.codehaus.plexus.util.StringUtils;
26
27
28
29
30
31
32 public class ScanningRequest
33 {
34 private final IndexingContext context;
35
36 private final ArtifactScanningListener artifactScanningListener;
37
38 private final String startingPath;
39
40 public ScanningRequest( final IndexingContext context, final ArtifactScanningListener artifactScanningListener )
41 {
42 this( context, artifactScanningListener, null );
43 }
44
45 public ScanningRequest( final IndexingContext context, final ArtifactScanningListener artifactScanningListener,
46 final String startingPath )
47 {
48 this.context = context;
49 this.artifactScanningListener = artifactScanningListener;
50 this.startingPath = startingPath;
51 }
52
53 public IndexingContext getIndexingContext()
54 {
55 return context;
56 }
57
58 public ArtifactScanningListener getArtifactScanningListener()
59 {
60 return artifactScanningListener;
61 }
62
63 public String getStartingPath()
64 {
65 return startingPath;
66 }
67
68 public File getStartingDirectory()
69 {
70 if ( StringUtils.isBlank( startingPath ) )
71 {
72 return getIndexingContext().getRepository();
73 }
74 else
75 {
76 return new File( getIndexingContext().getRepository(), startingPath );
77 }
78 }
79 }