From d4e2f95cf3d716091547757d9b6c7402155f4484 Mon Sep 17 00:00:00 2001 From: io42630 Date: Sat, 20 Jan 2024 10:19:35 +0100 Subject: [PATCH] clean / bump helper --- helper/README.md | 6 + helper/install-locally.sh | 10 -- helper/pom.xml | 114 +++++------------- .../java/com/olexyn/misp/helper/Ride.java | 40 ++---- 4 files changed, 48 insertions(+), 122 deletions(-) create mode 100644 helper/README.md delete mode 100755 helper/install-locally.sh diff --git a/helper/README.md b/helper/README.md new file mode 100644 index 0000000..68c13a7 --- /dev/null +++ b/helper/README.md @@ -0,0 +1,6 @@ +### MISP Helper + + +#### Build +* do `mvn clean install` for local +* or `mvn deploy` for local nexus \ No newline at end of file diff --git a/helper/install-locally.sh b/helper/install-locally.sh deleted file mode 100755 index bd0a074..0000000 --- a/helper/install-locally.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -version="0.1" -file="target/helper-${version}.jar" -groupId="com.olexyn.misp.helper" -artifactId="helper" - - - -mvn package -mvn install:install-file -Dfile=${file} -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -DgeneratePom=true diff --git a/helper/pom.xml b/helper/pom.xml index dad6ef5..67db04b 100644 --- a/helper/pom.xml +++ b/helper/pom.xml @@ -1,84 +1,34 @@ - - - 4.0.0 - - com.olexyn.misp.helper - helper - 0.1 - - helper - - - UTF-8 - 11 - 11 - - - - - junit - junit - 3.8.1 - - - org.json - json - 20190722 - - - - - - - - - maven-clean-plugin - 3.1.0 - - - maven-site-plugin - 3.7.1 - - - maven-project-info-reports-plugin - 3.0.0 - - - - maven-resources-plugin - 3.0.2 - - - maven-compiler-plugin - 3.8.0 - - - maven-surefire-plugin - 2.22.1 - - - maven-jar-plugin - 3.0.2 - - - maven-install-plugin - 2.5.2 - - - maven-deploy-plugin - 2.8.2 - - - - - - - - - maven-project-info-reports-plugin - - - + + 4.0.0 + + com.olexyn + zeeroot + 17.0.1 + + com.olexyn.misp + helper + 0.1 + helper + + + + com.olexyn + zeebom + 1.1.1 + pom + import + + + + + + org.json + json + + + org.projectlombok + lombok + + diff --git a/helper/src/main/java/com/olexyn/misp/helper/Ride.java b/helper/src/main/java/com/olexyn/misp/helper/Ride.java index 504fe2c..975d903 100644 --- a/helper/src/main/java/com/olexyn/misp/helper/Ride.java +++ b/helper/src/main/java/com/olexyn/misp/helper/Ride.java @@ -1,5 +1,7 @@ package com.olexyn.misp.helper; +import lombok.Getter; +import lombok.Setter; import org.json.JSONException; import org.json.JSONObject; @@ -8,50 +10,28 @@ public class Ride { private static long count = 0L; - final private Long id; + @Getter + private Long id; + @Getter + @Setter private String request; + @Getter + @Setter private String data; - - public Ride() { - id = count++; - } + public Ride() { id = count++; } public Ride(String jsonString) { this(new JSONObject(jsonString)); } public Ride(JSONObject obj) { - long _id; - try { _id = obj.getLong("id"); } catch (JSONException e) { _id = count++; } - id = _id; + try { id = obj.getLong("id"); } catch (JSONException e) { id = count++; } try { request = obj.getString("request"); } catch (JSONException e) { request = null; } try { data = obj.getString("data"); } catch (JSONException e) { data = null; } } - - public void setRequest(String request) { - this.request = request; - } - - public void setData(String data) { - this.data = data; - } - - public String getRequest() { - return this.request; - } - - public String getData() { - return this.data; - } - - public Long getID() { - return this.id; - } - - public String json() { JSONObject obj = new JSONObject(); obj.put("id", id);