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 {
51 this.context = context;
52
53 this.targetDir = targetDir;
54
55 this.createIncrementalChunks = true;
56
57 this.createChecksumFiles = false;
58
59 this.maxIndexChunks = MAX_CHUNKS;
60
61 this.useTargetProperties = false;
62
63 this.formats = Arrays.asList( IndexFormat.FORMAT_LEGACY, IndexFormat.FORMAT_V1 );
64 }
65
66 public IndexingContext getContext()
67 {
68 return context;
69 }
70
71 public void setContext( IndexingContext context )
72 {
73 this.context = context;
74 }
75
76
77
78
79 public void setFormats( Collection<IndexFormat> formats )
80 {
81 this.formats = formats;
82 }
83
84
85
86
87 public Collection<IndexFormat> getFormats()
88 {
89 return formats;
90 }
91
92 public File getTargetDir()
93 {
94 return targetDir;
95 }
96
97 public void setTargetDir( File targetDir )
98 {
99 this.targetDir = targetDir;
100 }
101
102 public boolean isCreateIncrementalChunks()
103 {
104 return createIncrementalChunks;
105 }
106
107 public void setCreateIncrementalChunks( boolean createIncrementalChunks )
108 {
109 this.createIncrementalChunks = createIncrementalChunks;
110 }
111
112 public boolean isCreateChecksumFiles()
113 {
114 return createChecksumFiles;
115 }
116
117 public void setCreateChecksumFiles( boolean createChecksumFiles )
118 {
119 this.createChecksumFiles = createChecksumFiles;
120 }
121
122 public int getMaxIndexChunks()
123 {
124 return maxIndexChunks;
125 }
126
127 public void setMaxIndexChunks( int maxIndexChunks )
128 {
129 this.maxIndexChunks = maxIndexChunks;
130 }
131
132 public boolean isUseTargetProperties()
133 {
134 return useTargetProperties;
135 }
136
137 public void setUseTargetProperties( boolean useTargetProperties )
138 {
139 this.useTargetProperties = useTargetProperties;
140 }
141
142
143
144
145 public static enum IndexFormat
146 {
147 FORMAT_LEGACY, FORMAT_V1;
148 }
149 }