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 | 0 | this( context, artifactScanningListener, null ); |
43 | 0 | } |
44 | |
|
45 | |
public ScanningRequest( final IndexingContext context, final ArtifactScanningListener artifactScanningListener, |
46 | |
final String startingPath ) |
47 | 214 | { |
48 | 214 | this.context = context; |
49 | 214 | this.artifactScanningListener = artifactScanningListener; |
50 | 214 | this.startingPath = startingPath; |
51 | 214 | } |
52 | |
|
53 | |
public IndexingContext getIndexingContext() |
54 | |
{ |
55 | 28428 | return context; |
56 | |
} |
57 | |
|
58 | |
public ArtifactScanningListener getArtifactScanningListener() |
59 | |
{ |
60 | 9526 | return artifactScanningListener; |
61 | |
} |
62 | |
|
63 | |
public String getStartingPath() |
64 | |
{ |
65 | 10 | return startingPath; |
66 | |
} |
67 | |
|
68 | |
public File getStartingDirectory() |
69 | |
{ |
70 | 214 | if ( StringUtils.isBlank( startingPath ) ) |
71 | |
{ |
72 | 205 | return getIndexingContext().getRepository(); |
73 | |
} |
74 | |
else |
75 | |
{ |
76 | 9 | return new File( getIndexingContext().getRepository(), startingPath ); |
77 | |
} |
78 | |
} |
79 | |
} |