1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package org.apache.creadur.tentacles.model;
18
19 import javax.xml.bind.annotation.XmlRootElement;
20 import java.util.ArrayList;
21 import java.util.List;
22
23 /**
24 * To be marshalled to json as an archives.json file
25 * Will contain a summary list of the artifacts intended for tabular display
26 */
27 @XmlRootElement
28 public class Archives {
29
30 private final List<Item> archives = new ArrayList<>();
31
32 /**
33 * Required for JAXB
34 */
35 public Archives() {
36 }
37
38 public List<Item> getArchives() {
39 return archives;
40 }
41
42 public void add(Item item) {
43 archives.add(item);
44 }
45
46 public Item addItem() {
47 final Item item = new Item();
48 archives.add(item);
49 return item;
50 }
51
52 public static class Item {
53
54 /**
55 * Required for JAXB
56 */
57 public Item() {
58 }
59
60 /**
61 * The path in the repo, minus the repo portion itself (relative)
62 */
63 private String path;
64
65 /**
66 * Just the file name with no path
67 */
68 private String name;
69
70 /**
71 * Jar, war, zip
72 */
73 private String type;
74
75 /**
76 * Count of how many jars are in this archive
77 */
78 private int jars;
79
80 /**
81 * Unique ID of the license file
82 */
83 private String license;
84
85
86 /**
87 * Unique ID of the notice file
88 */
89 private String notice;
90
91
92 public String getPath() {
93 return path;
94 }
95
96 public void setPath(String path) {
97 this.path = path;
98 }
99
100 public String getName() {
101 return name;
102 }
103
104 public void setName(String name) {
105 this.name = name;
106 }
107
108 public String getType() {
109 return type;
110 }
111
112 public void setType(String type) {
113 this.type = type;
114 }
115
116 public int getJars() {
117 return jars;
118 }
119
120 public void setJars(int jars) {
121 this.jars = jars;
122 }
123
124 public String getLicense() {
125 return license;
126 }
127
128 public void setLicense(String license) {
129 this.license = license;
130 }
131
132 public String getNotice() {
133 return notice;
134 }
135
136 public void setNotice(String notice) {
137 this.notice = notice;
138 }
139
140 public Item path(String path) {
141 this.path = path;
142 return this;
143 }
144
145 public Item name(String name) {
146 this.name = name;
147 return this;
148 }
149
150 public Item type(String type) {
151 this.type = type;
152 return this;
153 }
154
155 public Item jars(int jars) {
156 this.jars = jars;
157 return this;
158 }
159
160 public Item license(String license) {
161 this.license = license;
162 return this;
163 }
164
165 public Item notice(String notice) {
166 this.notice = notice;
167 return this;
168 }
169 }
170 }