1 | |
package org.apache.maven.index.packer; |
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 | |
import java.util.Arrays; |
24 | |
import java.util.Collection; |
25 | |
|
26 | |
import org.apache.maven.index.context.IndexingContext; |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
public class IndexPackingRequest |
32 | |
{ |
33 | |
private static final int MAX_CHUNKS = 30; |
34 | |
|
35 | |
private IndexingContext context; |
36 | |
|
37 | |
private File targetDir; |
38 | |
|
39 | |
private boolean createIncrementalChunks; |
40 | |
|
41 | |
private boolean createChecksumFiles; |
42 | |
|
43 | |
private int maxIndexChunks; |
44 | |
|
45 | |
private boolean useTargetProperties; |
46 | |
|
47 | |
private Collection<IndexFormat> formats; |
48 | |
|
49 | |
public IndexPackingRequest( IndexingContext context, File targetDir ) |
50 | 178 | { |
51 | 178 | this.context = context; |
52 | |
|
53 | 178 | this.targetDir = targetDir; |
54 | |
|
55 | 178 | this.createIncrementalChunks = true; |
56 | |
|
57 | 178 | this.createChecksumFiles = false; |
58 | |
|
59 | 178 | this.maxIndexChunks = MAX_CHUNKS; |
60 | |
|
61 | 178 | this.useTargetProperties = false; |
62 | |
|
63 | 178 | this.formats = Arrays.asList( IndexFormat.FORMAT_LEGACY, IndexFormat.FORMAT_V1 ); |
64 | 178 | } |
65 | |
|
66 | |
public IndexingContext getContext() |
67 | |
{ |
68 | 1402 | return context; |
69 | |
} |
70 | |
|
71 | |
public void setContext( IndexingContext context ) |
72 | |
{ |
73 | 0 | this.context = context; |
74 | 0 | } |
75 | |
|
76 | |
|
77 | |
|
78 | |
|
79 | |
public void setFormats( Collection<IndexFormat> formats ) |
80 | |
{ |
81 | 8 | this.formats = formats; |
82 | 8 | } |
83 | |
|
84 | |
|
85 | |
|
86 | |
|
87 | |
public Collection<IndexFormat> getFormats() |
88 | |
{ |
89 | 392 | return formats; |
90 | |
} |
91 | |
|
92 | |
public File getTargetDir() |
93 | |
{ |
94 | 1419 | return targetDir; |
95 | |
} |
96 | |
|
97 | |
public void setTargetDir( File targetDir ) |
98 | |
{ |
99 | 0 | this.targetDir = targetDir; |
100 | 0 | } |
101 | |
|
102 | |
public boolean isCreateIncrementalChunks() |
103 | |
{ |
104 | 159 | return createIncrementalChunks; |
105 | |
} |
106 | |
|
107 | |
public void setCreateIncrementalChunks( boolean createIncrementalChunks ) |
108 | |
{ |
109 | 164 | this.createIncrementalChunks = createIncrementalChunks; |
110 | 164 | } |
111 | |
|
112 | |
public boolean isCreateChecksumFiles() |
113 | |
{ |
114 | 602 | return createChecksumFiles; |
115 | |
} |
116 | |
|
117 | |
public void setCreateChecksumFiles( boolean createChecksumFiles ) |
118 | |
{ |
119 | 7 | this.createChecksumFiles = createChecksumFiles; |
120 | 7 | } |
121 | |
|
122 | |
public int getMaxIndexChunks() |
123 | |
{ |
124 | 20 | return maxIndexChunks; |
125 | |
} |
126 | |
|
127 | |
public void setMaxIndexChunks( int maxIndexChunks ) |
128 | |
{ |
129 | 2 | this.maxIndexChunks = maxIndexChunks; |
130 | 2 | } |
131 | |
|
132 | |
public boolean isUseTargetProperties() |
133 | |
{ |
134 | 196 | return useTargetProperties; |
135 | |
} |
136 | |
|
137 | |
public void setUseTargetProperties( boolean useTargetProperties ) |
138 | |
{ |
139 | 8 | this.useTargetProperties = useTargetProperties; |
140 | 8 | } |
141 | |
|
142 | |
|
143 | |
|
144 | |
|
145 | 3 | public static enum IndexFormat |
146 | |
{ |
147 | 1 | FORMAT_LEGACY, FORMAT_V1; |
148 | |
} |
149 | |
} |