Author: dblevins
Date: Mon Aug 4 05:00:57 2014
New Revision: 1615488
URL: http://svn.apache.org/r1615488
Log:
barely started with writing json version of archive data
Added:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/ArchivesJson.java
(with props)
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/model/
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/model/Archives.java
(with props)
creadur/tentacles/trunk/src/test/java/org/apache/creadur/tentacles/ArchivesJsonTest.java
(with props)
Modified:
creadur/tentacles/trunk/pom.xml
Modified: creadur/tentacles/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/creadur/tentacles/trunk/pom.xml?rev=1615488&r1=1615487&r2=1615488&view=diff
==============================================================================
--- creadur/tentacles/trunk/pom.xml (original)
+++ creadur/tentacles/trunk/pom.xml Mon Aug 4 05:00:57 2014
@@ -40,13 +40,19 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
- <version>4.1.1</version>
+ <version>4.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
- <version>4.1.1</version>
+ <version>4.3.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.module</groupId>
+ <artifactId>jackson-module-jaxb-annotations</artifactId>
+ <version>2.4.0</version>
</dependency>
<dependency>
Added:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/ArchivesJson.java
URL:
http://svn.apache.org/viewvc/creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/ArchivesJson.java?rev=1615488&view=auto
==============================================================================
---
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/ArchivesJson.java
(added)
+++
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/ArchivesJson.java
Mon Aug 4 05:00:57 2014
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.creadur.tentacles;
+
+public class ArchivesJson {
+
+
+
+}
Propchange:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/ArchivesJson.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/model/Archives.java
URL:
http://svn.apache.org/viewvc/creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/model/Archives.java?rev=1615488&view=auto
==============================================================================
---
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/model/Archives.java
(added)
+++
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/model/Archives.java
Mon Aug 4 05:00:57 2014
@@ -0,0 +1,170 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.creadur.tentacles.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * To be marshalled to json as an archives.json file
+ * Will contain a summary list of the artifacts intended for tabular display
+ */
+@XmlRootElement
+public class Archives {
+
+ private final List<Item> archives = new ArrayList<Item>();
+
+ /**
+ * Required for JAXB
+ */
+ public Archives() {
+ }
+
+ public List<Item> getArchives() {
+ return archives;
+ }
+
+ public void add(Item item) {
+ archives.add(item);
+ }
+
+ public Item addItem() {
+ final Item item = new Item();
+ archives.add(item);
+ return item;
+ }
+
+ public static class Item {
+
+ /**
+ * Required for JAXB
+ */
+ public Item() {
+ }
+
+ /**
+ * The path in the repo, minus the repo portion itself (relative)
+ */
+ private String path;
+
+ /**
+ * Just the file name with no path
+ */
+ private String name;
+
+ /**
+ * Jar, war, zip
+ */
+ private String type;
+
+ /**
+ * Count of how many jars are in this archive
+ */
+ private int jars;
+
+ /**
+ * Unique ID of the license file
+ */
+ private String license;
+
+
+ /**
+ * Unique ID of the notice file
+ */
+ private String notice;
+
+
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public int getJars() {
+ return jars;
+ }
+
+ public void setJars(int jars) {
+ this.jars = jars;
+ }
+
+ public String getLicense() {
+ return license;
+ }
+
+ public void setLicense(String license) {
+ this.license = license;
+ }
+
+ public String getNotice() {
+ return notice;
+ }
+
+ public void setNotice(String notice) {
+ this.notice = notice;
+ }
+
+ public Item path(String path) {
+ this.path = path;
+ return this;
+ }
+
+ public Item name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public Item type(String type) {
+ this.type = type;
+ return this;
+ }
+
+ public Item jars(int jars) {
+ this.jars = jars;
+ return this;
+ }
+
+ public Item license(String license) {
+ this.license = license;
+ return this;
+ }
+
+ public Item notice(String notice) {
+ this.notice = notice;
+ return this;
+ }
+ }
+}
Propchange:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/model/Archives.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
creadur/tentacles/trunk/src/test/java/org/apache/creadur/tentacles/ArchivesJsonTest.java
URL:
http://svn.apache.org/viewvc/creadur/tentacles/trunk/src/test/java/org/apache/creadur/tentacles/ArchivesJsonTest.java?rev=1615488&view=auto
==============================================================================
---
creadur/tentacles/trunk/src/test/java/org/apache/creadur/tentacles/ArchivesJsonTest.java
(added)
+++
creadur/tentacles/trunk/src/test/java/org/apache/creadur/tentacles/ArchivesJsonTest.java
Mon Aug 4 05:00:57 2014
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.creadur.tentacles;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
+import org.apache.creadur.tentacles.model.Archives;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ArchivesJsonTest extends Assert {
+
+ @Test
+ public void test() throws Exception {
+
+ final Archives archives = new Archives();
+ archives.addItem()
+ .name("hello.jar")
+ .path("one/two/hello.jar")
+ ;
+
+ final ObjectMapper mapper = new ObjectMapper();
+ JaxbAnnotationModule module = new JaxbAnnotationModule();
+ // configure as necessary
+ mapper.registerModule(module);
+
+ mapper.writerWithDefaultPrettyPrinter().writeValue(System.out,
archives);
+ }
+}
Propchange:
creadur/tentacles/trunk/src/test/java/org/apache/creadur/tentacles/ArchivesJsonTest.java
------------------------------------------------------------------------------
svn:eol-style = native