1
2
3
4
5 package edu.internet2.middleware.grouperInstaller;
6
7 import java.io.File;
8
9 import edu.internet2.middleware.grouperInstaller.util.GrouperInstallerUtils;
10
11
12
13
14
15 public class GrouperInstallerIndexFile {
16
17
18
19
20 private StringBuilder errors = new StringBuilder();
21
22
23
24
25
26
27 public StringBuilder getErrors() {
28 return this.errors;
29 }
30
31
32
33
34
35
36 public void setErrors(StringBuilder errors1) {
37 this.errors = errors1;
38 }
39
40
41
42
43 public static enum PatchFileType {
44
45
46
47
48 file("files"),
49
50
51
52
53 clazz("classes"),
54
55
56
57
58 lib("lib"),
59
60
61
62
63 bin("bin");
64
65
66
67
68 private String dirName;
69
70
71
72
73
74 public String getDirName() {
75 return this.dirName;
76 }
77
78
79
80
81
82 public void setDirName(String dirName1) {
83 this.dirName = dirName1;
84 }
85
86
87
88
89
90 private PatchFileType(String theDirName) {
91 this.dirName = theDirName;
92 }
93
94 }
95
96
97
98
99 public GrouperInstallerIndexFile() {
100 }
101
102
103
104
105 private boolean hasMultipleFilesBySimpleName;
106
107
108
109
110 private boolean hasMultipleFilesByPath;
111
112
113
114
115 private boolean hasMultipleFilesByRelativePath;
116
117
118
119
120
121 public boolean isHasMultipleFilesByRelativePath() {
122 return this.hasMultipleFilesByRelativePath;
123 }
124
125
126
127
128
129 public void setHasMultipleFilesByRelativePath(boolean hasMultipleFilesByRelativePath1) {
130 this.hasMultipleFilesByRelativePath = hasMultipleFilesByRelativePath1;
131 }
132
133
134
135
136
137 public boolean isHasMultipleFilesBySimpleName() {
138 return this.hasMultipleFilesBySimpleName;
139 }
140
141
142
143
144
145
146
147 public void setHasMultipleFilesBySimpleName(boolean hasMultipleFilesBysimpleName1) {
148 this.hasMultipleFilesBySimpleName = hasMultipleFilesBysimpleName1;
149 }
150
151
152
153
154 private String relativePath;
155
156
157
158
159
160 public String getRelativePath() {
161 return this.relativePath;
162 }
163
164
165
166
167
168 @Override
169 public String toString() {
170 return this.simpleName + ", relPath: " + this.relativePath + ", type: " + this.patchFileType
171 + ", hasMult: " + this.hasMultipleFilesBySimpleName + ", " + this.hasMultipleFilesByRelativePath + ", "
172 + this.hasMultipleFilesByPath;
173
174 }
175
176
177
178
179
180 public void setRelativePath(String relativePath1) {
181 this.relativePath = relativePath1;
182 }
183
184
185
186
187
188 public boolean isHasMultipleFilesByPath() {
189 return this.hasMultipleFilesByPath;
190 }
191
192
193
194
195
196
197
198 public void setHasMultipleFilesByPath(boolean hasMultipleFilesByPath1) {
199 this.hasMultipleFilesByPath = hasMultipleFilesByPath1;
200 }
201
202
203
204
205 private String simpleName;
206
207
208
209
210
211
212 public String getSimpleName() {
213 return this.simpleName;
214 }
215
216
217
218
219
220
221 public void setSimpleName(String simpleName1) {
222 this.simpleName = simpleName1;
223 }
224
225
226
227
228
229
230 public PatchFileType getPatchFileType() {
231 return this.patchFileType;
232 }
233
234
235
236
237
238
239 public void setPatchFileType(PatchFileType patchFileType1) {
240 this.patchFileType = patchFileType1;
241 }
242
243
244
245
246
247
248 public String getPath() {
249 return this.path;
250 }
251
252
253
254
255
256
257 public void setPath(String path1) {
258 this.path = path1;
259 }
260
261
262
263
264
265
266 public File getFile() {
267 return this.file;
268 }
269
270
271
272
273
274
275 public void setFile(File file1) {
276 this.file = file1;
277 this.sha1 = null;
278 }
279
280
281
282
283 private String sha1;
284
285
286
287
288
289 public String computeSha1() {
290 if (this.sha1 == null) {
291 if (this.file == null){
292 throw new RuntimeException("Need a file");
293 }
294 if (this.file.isDirectory()) {
295 throw new RuntimeException("Cant do sha1 on directory: " + this.file.getAbsolutePath());
296 }
297 this.sha1 = GrouperInstallerUtils.fileSha1(this.file);
298 }
299 return this.sha1;
300 }
301
302
303
304
305 private PatchFileType patchFileType;
306
307
308
309
310 private String path;
311
312
313
314
315 private File file;
316
317 }